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.7 kB 56 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) 17 .replace(/^[a-z]+:\/\//, "") 18 .split(/[:/]/)[0] 19 ); 20 const remote = $derived(`git@${sshHost}:${repo.repoDid ?? `${repo.ownerHandle}/${repo.name}`}`); 21</script> 22 23{#snippet bullet(n: number)} 24 <span 25 class="mr-2 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-background-inset align-middle font-mono text-xs" 26 > 27 {n} 28 </span> 29{/snippet} 30 31{#if isOwner} 32 <div class="flex w-full place-content-center"> 33 <div class="flex w-fit flex-col gap-4 py-6 text-sm"> 34 <p>This is an empty repository. To get started:</p> 35 <p> 36 {@render bullet(1)}First, generate a new 37 <a 38 href="https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key" 39 rel="noopener" 40 class="underline">SSH key pair</a 41 >. 42 </p> 43 <p> 44 {@render bullet(2)}Then add the public key from the 45 <a href={resolve("/settings/keys")} class="underline">keys page</a> in your settings. 46 </p> 47 <p> 48 {@render bullet(3)}Configure your remote to 49 <code class="rounded bg-background-inset px-1 font-mono">{remote}</code> 50 </p> 51 <p>{@render bullet(4)}Push!</p> 52 </div> 53 </div> 54{:else} 55 <p class="py-6 text-center text-foreground-subtle">This is an empty repository.</p> 56{/if}