johnandersen777.bsky.social/knotless
git that lives in your Atmosphere account
Forked from chadtmiller.com/knotless
0
0
<script lang="ts">
import { urlPath } from '#lib/format.ts';
/** Links up `path`, each segment to its tree, from the repository's root at `root`; the last is the page itself. */
let { name, root, path }: { name: string; root: string; path: string } = $props();
const segments = $derived(path.split('/').filter(Boolean));
const at = (i: number) => segments.slice(0, i + 1).join('/');
</script>
<nav class="crumbs">
{#if segments.length}<a href={root}>{name}</a>{:else}<b>{name}</b
>{/if}{#each segments as segment, i (i)}<span class="sep">/</span
>{#if i + 1 === segments.length}<b>{segment}</b>{:else}<a href="{root}/{urlPath(at(i))}"
>{segment}</a
>{/if}{/each}
</nav>