mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 17:20:14 +00:00
port docs to sveltekit (very broken)
This commit is contained in:
parent
17ee73f264
commit
b19c900cc3
39 changed files with 3275 additions and 8052 deletions
27
docs/src/components/Footer.svelte
Normal file
27
docs/src/components/Footer.svelte
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<script lang="ts">
|
||||
import { env } from "$env/dynamic/public"
|
||||
|
||||
// @ts-ignore
|
||||
const version = __COMMIT_HASH__.slice(1, __COMMIT_HASH__.length - 1)
|
||||
</script>
|
||||
|
||||
<footer class="footer items-center p-4">
|
||||
<nav class="grid-flow-col gap-4">
|
||||
<span
|
||||
>Commit: <a
|
||||
aria-label="View commit on github"
|
||||
class="underline"
|
||||
href={`${
|
||||
env.PUBLIC_REPOSITORY_URL
|
||||
? env.PUBLIC_REPOSITORY_URL
|
||||
: "https://github.com/Draconizations/pk-dashboard-sveltekit"
|
||||
}/commit/${version}`}>{version}</a
|
||||
>
|
||||
</span>
|
||||
</nav>
|
||||
<nav class="grid-flow-col gap-4 md:place-self-center md:justify-self-end">
|
||||
<a class="link-hover" href="/about">About</a>
|
||||
<a class="link-hover" href="/privacy">Privacy</a>
|
||||
<a class="link-hover" href="/changelog">Changelog</a>
|
||||
</nav>
|
||||
</footer>
|
||||
139
docs/src/components/NavBar.svelte
Normal file
139
docs/src/components/NavBar.svelte
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
<script lang="ts">
|
||||
import {
|
||||
IconMenu2,
|
||||
IconBook,
|
||||
IconBrandDiscord,
|
||||
IconShare3,
|
||||
IconUsers,
|
||||
IconBoxMultiple,
|
||||
IconAdjustments,
|
||||
IconPaint,
|
||||
IconLogout,
|
||||
IconAddressBook,
|
||||
IconHome,
|
||||
IconSettings,
|
||||
IconStatusChange,
|
||||
IconInfoCircle,
|
||||
IconDashboard,
|
||||
IconLayoutDashboard,
|
||||
} from "@tabler/icons-svelte"
|
||||
|
||||
let userMenu: HTMLDetailsElement
|
||||
let navbarMenu: HTMLDetailsElement
|
||||
</script>
|
||||
|
||||
<div class="navbar bg-base-100">
|
||||
<div class="navbar-start flex-1">
|
||||
<details class="dropdown" bind:this={navbarMenu}>
|
||||
<summary class="btn btn-ghost md:hidden">
|
||||
<IconMenu2 />
|
||||
</summary>
|
||||
<ul class="menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-52">
|
||||
<li>
|
||||
<a href="/" onclick={() => (navbarMenu.open = false)}>
|
||||
<IconHome /> Homepage
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="https://discord.com/oauth2/authorize?client_id=466378653216014359&scope=bot%20applications.commands&permissions=536995904"
|
||||
onclick={() => (navbarMenu.open = false)}
|
||||
>
|
||||
<IconShare3 /> Invite bot
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://pluralkit.me/" onclick={() => (navbarMenu.open = false)}
|
||||
><IconBook /> Documentation</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://discord.gg/PczBt78" onclick={() => (navbarMenu.open = false)}
|
||||
><IconBrandDiscord /> Support server</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
<a href="/" class="hidden text-xl btn btn-ghost md:inline-flex">PluralKit</a>
|
||||
</div>
|
||||
<div class="hidden navbar-center md:flex">
|
||||
<ul class="px-1 menu menu-horizontal">
|
||||
<li><a href="https://dash.pluralkit.me/"><IconLayoutDashboard /> Web dashboard</a></li>
|
||||
<li><a href="https://discord.gg/PczBt78"><IconBrandDiscord /> Support server</a></li>
|
||||
<li>
|
||||
<a
|
||||
href="https://discord.com/oauth2/authorize?client_id=466378653216014359&scope=bot%20applications.commands&permissions=536995904"
|
||||
>
|
||||
<IconShare3 /> Invite bot
|
||||
</a>
|
||||
</li>
|
||||
<li><a href="https://status.pluralkit.me"><IconInfoCircle /> Status</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="navbar-end w-auto">
|
||||
<a href="/settings#theme" class="mr-4 tooltip tooltip-bottom" data-tip="Change theme"
|
||||
><IconPaint /></a
|
||||
>
|
||||
{#if false /*dash.user*/}
|
||||
<details class="dropdown dropdown-left" bind:this={userMenu}>
|
||||
<summary class="mr-2 list-none">
|
||||
{#if false /*dash.user.avatar_url*/}
|
||||
<div class="avatar">
|
||||
<div class="w-12 rounded-full">
|
||||
<!-- <img alt="your system avatar" src={dash.user.avatar_url} /> -->
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="avatar">
|
||||
<div class="w-12 rounded-full">
|
||||
<img alt="An icon of myriad" src="/myriad_write.png" />
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</summary>
|
||||
<ul
|
||||
data-sveltekit-preload-data="tap"
|
||||
class="menu menu-sm menu-dropdown dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-36"
|
||||
>
|
||||
<!-- <li>
|
||||
<a href={`/dash/${dash.user?.id}?tab=overview`} onclick={() => (userMenu.open = false)}
|
||||
><IconAdjustments /> Overview</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a href={`/dash/${dash.user?.id}?tab=system`} onclick={() => (userMenu.open = false)}
|
||||
><IconAddressBook /> System</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a href={`/dash/${dash.user?.id}?tab=members`} onclick={() => (userMenu.open = false)}
|
||||
><IconUsers /> Members</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a href={`/dash/${dash.user?.id}?tab=groups`} onclick={() => (userMenu.open = false)}
|
||||
><IconBoxMultiple /> Groups</a
|
||||
>
|
||||
</li> -->
|
||||
<hr class="my-2" />
|
||||
<li>
|
||||
<a href="/settings/general" onclick={() => (userMenu.open = false)}
|
||||
><IconSettings /> Settings</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<form method="post" action="/?/logout">
|
||||
<IconLogout />
|
||||
<input
|
||||
onclick={() => (userMenu.open = false)}
|
||||
class="text-error w-min"
|
||||
type="submit"
|
||||
value="Logout"
|
||||
/>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
107
docs/src/components/Sidebar.svelte
Normal file
107
docs/src/components/Sidebar.svelte
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
<script lang="ts">
|
||||
import { page } from "$app/stores";
|
||||
|
||||
const mdModules = import.meta.glob('/content/**/*.md', { eager: true }) as Record<string, { metadata?: { title?: string; permalink?: string } }>;
|
||||
|
||||
const pathToTitle: Record<string, string> = {};
|
||||
for (const [filePath, mod] of Object.entries(mdModules)) {
|
||||
const urlPath = filePath
|
||||
.replace('/content', '')
|
||||
.replace(/\/index\.md$/, '')
|
||||
.replace(/\.md$/, '');
|
||||
|
||||
if (mod.metadata?.title) {
|
||||
pathToTitle[urlPath || '/'] = mod.metadata.title;
|
||||
}
|
||||
}
|
||||
|
||||
function getTitle(path: string): string {
|
||||
return pathToTitle[path] || path.split('/').pop() || path;
|
||||
}
|
||||
|
||||
const sidebar = [
|
||||
{
|
||||
title: "Home",
|
||||
href: "/",
|
||||
},
|
||||
{
|
||||
title: "Add to your server",
|
||||
href: "https://discord.com/oauth2/authorize?client_id=466378653216014359&scope=bot%20applications.commands&permissions=536995904",
|
||||
},
|
||||
{
|
||||
title: "Updates",
|
||||
sidebarDepth: 1,
|
||||
children: [
|
||||
"/posts",
|
||||
"/changelog",
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "Documentation",
|
||||
sidebarDepth: 2,
|
||||
children: [
|
||||
"/getting-started",
|
||||
"/user-guide",
|
||||
"/command-list",
|
||||
"/privacy-policy",
|
||||
"/terms-of-service",
|
||||
"/faq",
|
||||
"/tips-and-tricks"
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "For server staff",
|
||||
children: [
|
||||
"/staff/permissions",
|
||||
"/staff/moderation",
|
||||
"/staff/disabling",
|
||||
"/staff/logging",
|
||||
"/staff/compatibility",
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "API Documentation",
|
||||
children: [
|
||||
"/api/changelog",
|
||||
"/api/reference",
|
||||
"/api/endpoints",
|
||||
"/api/models",
|
||||
"/api/errors",
|
||||
"/api/dispatch"
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "Join the support server",
|
||||
href: "https://discord.gg/PczBt78",
|
||||
},
|
||||
];
|
||||
|
||||
function isActive(href: string): boolean {
|
||||
return $page.url.pathname === href;
|
||||
}
|
||||
</script>
|
||||
|
||||
<aside class="w-80 bg-base-200 p-4 overflow-y-auto shrink-0 min-h-0">
|
||||
<ul class="menu w-full">
|
||||
{#each sidebar as item}
|
||||
{#if item.children}
|
||||
<li class="menu-title flex flex-row items-center gap-2 mt-4">
|
||||
{item.title}
|
||||
</li>
|
||||
{#each item.children as child}
|
||||
<li>
|
||||
<a href={child} class:active={isActive(child)}>
|
||||
{getTitle(child)}
|
||||
</a>
|
||||
</li>
|
||||
{/each}
|
||||
{:else}
|
||||
<li>
|
||||
<a href={item.href} class:active={isActive(item.href)}>
|
||||
{item.title}
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/each}
|
||||
</ul>
|
||||
</aside>
|
||||
Loading…
Add table
Add a link
Reference in a new issue