site: init

This commit is contained in:
Glen Huang
2025-10-06 19:21:01 +08:00
committed by Johannes Kirschbauer
parent 6b5dca5842
commit d92623f07e
26 changed files with 1980 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<script lang="ts">
import favicon from '$lib/assets/favicon.svg';
let { children } = $props();
</script>
<svelte:head>
<link rel="icon" href={favicon} />
</svelte:head>
{@render children?.()}

View File

@@ -0,0 +1,4 @@
<h1>Welcome to Clan</h1>
<p>
<a href="/docs">Show Docs</a>
</p>

View File

@@ -0,0 +1,12 @@
<script>
let { data, children } = $props();
let { paths } = data;
</script>
<nav>
{#each paths as path}
<li><a href={`/docs/${path}`}>{path}</a></li>
{/each}
<li><a href="/">Home</a></li>
</nav>
{@render children()}

View File

@@ -0,0 +1,8 @@
const articles = import.meta.glob("./**/*.md");
export function load() {
const paths = Object.keys(articles).map((key) =>
key.slice("./".length, -".md".length),
);
return { paths };
}

View File

@@ -0,0 +1,3 @@
<h1>What is Clan</h1>
Content

View File

@@ -0,0 +1,6 @@
<script lang="ts">
let { data } = $props();
let { Content, metadata } = data;
</script>
<Content />

View File

@@ -0,0 +1,24 @@
import { error } from "@sveltejs/kit";
import type { Component } from "svelte";
const articles = import.meta.glob<{
metadata: {
layout?: string;
};
default: Component;
}>("../**/*.md");
export async function load({ params }) {
const article = articles[`../${params.path}.md`];
if (!article) {
error(404, "");
}
const { metadata, default: Content } = await article();
return {
Content,
metadata: {
...metadata,
},
};
}

View File

@@ -0,0 +1 @@
# Deep Overview

View File

@@ -0,0 +1 @@
# Getting Started Overview

View File

@@ -0,0 +1 @@
# Reference Overview