This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / web / src / lib / components / repo / EmptyRepo.svelte
1.6 kB 54 lines
1<script lang="ts"> 2 import { resolve } from "$app/paths"; 3 import { getAuth } from "$lib/auth.svelte"; 4 import type { RepoInfo } from "./types"; 5 6 interface Props { 7 repo: RepoInfo; 8 } 9 10 let { repo }: Props = $props(); 11 12 const auth = getAuth(); 13 const isOwner = $derived(auth.currentDid === repo.ownerDid); 14 // same host rewrite as the clone urls 15 const sshHost = $derived( 16 (repo.knot === "knot1.tangled.sh" ? "tangled.org" : repo.knot).split(":")[0] 17 ); 18 const remote = $derived(`git@${sshHost}:${repo.repoDid ?? `${repo.ownerHandle}/${repo.name}`}`); 19</script> 20 21{#snippet bullet(n: number)} 22 <span 23 class="mr-2 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-background-inset align-middle font-mono text-xs" 24 > 25 {n} 26 </span> 27{/snippet} 28 29{#if isOwner} 30 <div class="flex w-full place-content-center"> 31 <div class="flex w-fit flex-col gap-4 py-6 text-sm"> 32 <p>This is an empty repository. To get started:</p> 33 <p> 34 {@render bullet(1)}First, generate a new 35 <a 36 href="https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key" 37 rel="noopener" 38 class="underline">SSH key pair</a 39 >. 40 </p> 41 <p> 42 {@render bullet(2)}Then add the public key from the 43 <a href={resolve("/settings/keys")} class="underline">keys page</a> in your settings. 44 </p> 45 <p> 46 {@render bullet(3)}Configure your remote to 47 <code class="rounded bg-background-inset px-1 font-mono">{remote}</code> 48 </p> 49 <p>{@render bullet(4)}Push!</p> 50 </div> 51 </div> 52{:else} 53 <p class="py-6 text-center text-foreground-subtle">This is an empty repository.</p> 54{/if}