Fix Docs
This commit is contained in:
parent
07efc68286
commit
01f64c14cc
16 changed files with 105 additions and 37 deletions
|
@ -6,13 +6,13 @@ import {ArrowDownCircle} from "@iconoir/vue"
|
|||
<div class="mobile-docs-dropdown">
|
||||
<span onclick="ToggleMDD()">{Project} <ArrowDownCircle/></span>
|
||||
<div class="mdd-expandable">
|
||||
<slot name="sidebar-items"/>
|
||||
<slot/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="sb-docs">
|
||||
<slot name="sidebar-items"/>
|
||||
<slot/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
8
src/content/config.ts
Normal file
8
src/content/config.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { defineCollection, z } from 'astro:content';
|
||||
|
||||
const docs = defineCollection({
|
||||
type: 'content',
|
||||
schema: z.object({title: z.string()}),
|
||||
});
|
||||
|
||||
export const Documents = { docs }
|
|
@ -9,53 +9,22 @@ import Default from "@layouts/Default.astro";
|
|||
|
||||
// Components
|
||||
import Sidebar from "@components/docs/sidebar.astro";
|
||||
|
||||
// Hightlight Active Project
|
||||
if (ProjectCollection === 'minpluto') {
|
||||
var Hightlight_MinPluto = true
|
||||
}
|
||||
if (ProjectCollection === 'zorn') {
|
||||
var Hightlight_Zorn = true
|
||||
}
|
||||
if (ProjectCollection === 'penpot-desktop') {
|
||||
var Hightlight_Penpot = true
|
||||
}
|
||||
---
|
||||
<Default MobileTitle="SudoVanilla Documentation">
|
||||
<Fragment slot="sub-header">
|
||||
<div>
|
||||
<p class="header-sub-service"><span id="show-w-scroll">SudoVanilla</span> Documentations</p>
|
||||
<!-- {EnableSearch ? <a href="#" onclick="ToggleSearchOnclick()"><Search/> Search</a> : null} -->
|
||||
</div>
|
||||
<div>
|
||||
{Hightlight_MinPluto ?
|
||||
<a style="color: white;" href="/docs/minpluto/introduction/">MinPluto</a>
|
||||
:
|
||||
<a href="/docs/minpluto/introduction/">MinPluto</a>
|
||||
}
|
||||
{Hightlight_Zorn ?
|
||||
<a style="color: white;" href="/docs/zorn/introduction/">Zorn Player</a>
|
||||
:
|
||||
<a href="/docs/zorn/introduction/">Zorn Player</a>
|
||||
}
|
||||
{Hightlight_Penpot ?
|
||||
<a style="color: white;" href="/docs/penpot-desktop/introduction/">Penpot Desktop</a>
|
||||
:
|
||||
<a href="/docs/penpot-desktop/introduction/">Penpot Desktop</a>
|
||||
}
|
||||
<!-- <a href="/docs/minpluto/introduction/">MinPluto</a>
|
||||
<a href="/docs/zorn/introduction/">Zorn Player</a>
|
||||
<a href="/docs/penpot-desktop/introduction/">Penpot Desktop</a> -->
|
||||
</div>
|
||||
</Fragment>
|
||||
<Fragment slot="body">
|
||||
<div class="document-layout">
|
||||
<!-- {EnableSearch ?
|
||||
<SearchModal/>
|
||||
:
|
||||
null
|
||||
} -->
|
||||
<Sidebar>
|
||||
<slot slot="sidebar-items"/>
|
||||
</Sidebar>
|
||||
<div class="doc-content">
|
||||
<slot slot="content"/>
|
||||
</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
|
|
91
src/pages/docs/[...slug].astro
Normal file
91
src/pages/docs/[...slug].astro
Normal file
|
@ -0,0 +1,91 @@
|
|||
---
|
||||
// Icons
|
||||
import {ServerConnection,PeaceHand, SlashSquare, ClipboardCheck} from "@iconoir/vue";
|
||||
import {ServerConnection,PeaceHand, QuestionMark, WifiOff, DownloadCircle, ShieldAlert, ChatBubble} from "@iconoir/vue";
|
||||
|
||||
// Get Colletion and Slug
|
||||
import { getCollection, getEntry } from "astro:content";
|
||||
import Document from "@layouts/Document.astro"
|
||||
|
||||
const { slug } = Astro.params;
|
||||
if (!slug) throw new Error("Slug not found");
|
||||
const post = await getEntry("docs", slug);
|
||||
|
||||
if (!post) throw new Error("No post found for this slug");
|
||||
const { Content } = await post.render();
|
||||
|
||||
/// Generate static pages
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection("docs");
|
||||
return posts.map((post) => ({ params: { slug: post.slug } }));
|
||||
}
|
||||
export const prerender = true;
|
||||
|
||||
// Components
|
||||
import Sidebar from "@components/docs/sidebar.astro";
|
||||
---
|
||||
|
||||
<Document>
|
||||
<div class="document-layout">
|
||||
<Sidebar>
|
||||
<h2>Zorn</h2>
|
||||
<a href="/docs/zorn/introduction/">
|
||||
<PeaceHand/>
|
||||
<p>Introduction </p>
|
||||
</a>
|
||||
<h2>MinPluto</h2>
|
||||
<a href="/docs/minpluto/introduction/">
|
||||
<PeaceHand/>
|
||||
<p>Introduction </p>
|
||||
</a>
|
||||
<a href="/docs/minpluto/compatibility/">
|
||||
<ClipboardCheck />
|
||||
<p>Compatibility</p>
|
||||
</a>
|
||||
<a href="/docs/minpluto/requirements/">
|
||||
<ClipboardCheck />
|
||||
<p>Requirements</p>
|
||||
</a>
|
||||
<a href="/docs/minpluto/self-hosting/">
|
||||
<ServerConnection />
|
||||
<p>Self-Hosting</p>
|
||||
</a>
|
||||
<a href="/docs/minpluto/api/">
|
||||
<SlashSquare />
|
||||
<p>API</p>
|
||||
</a>
|
||||
<h2>Penpot Desktop</h2>
|
||||
<a href="/docs/penpot-desktop/introduction/">
|
||||
<PeaceHand/>
|
||||
<p>Introduction </p>
|
||||
</a>
|
||||
<a href="/docs/penpot-desktop/faq/">
|
||||
<QuestionMark />
|
||||
<p>FAQ</p>
|
||||
</a>
|
||||
<a href="/docs/penpot-desktop/offline-use/">
|
||||
<WifiOff />
|
||||
<p>Offline Use</p>
|
||||
</a>
|
||||
<a href="/docs/penpot-desktop/instance/">
|
||||
<ServerConnection />
|
||||
<p>Instance</p>
|
||||
</a>
|
||||
<a href="/docs/penpot-desktop/progress/">
|
||||
<DownloadCircle />
|
||||
<p>Installation</p>
|
||||
</a>
|
||||
<a href="/docs/penpot-desktop/progress/">
|
||||
<ShieldAlert />
|
||||
<p>Security Policy</p>
|
||||
</a>
|
||||
<a href="/docs/penpot-desktop/progress/">
|
||||
<ChatBubble />
|
||||
<p>Support</p>
|
||||
</a>
|
||||
</Sidebar>
|
||||
<div class="doc-content">
|
||||
<Content/>
|
||||
</div>
|
||||
</div>
|
||||
</Document>
|
Loading…
Reference in a new issue