From 710ccfd5b19502211aa884a4cb0f723b81acf4cc Mon Sep 17 00:00:00 2001
From: eveeifyeve
Date: Fri, 12 Jul 2024 22:20:54 +1000
Subject: [PATCH] feat: wiki first page
Co-authored-by: DuckeyDev
---
src/content/config.ts | 4 ++--
src/content/wiki/players/index.mdx | 21 +++++++++++++++++++++
src/layouts/wiki.astro | 29 -----------------------------
src/layouts/wikiContent.astro | 29 +++++++++++++++++++++++++++++
src/pages/wiki/[...slug].astro | 21 +++++++++++++++++++++
src/pages/wiki/index.astro | 21 ++++++++++++++++++++-
6 files changed, 93 insertions(+), 32 deletions(-)
create mode 100644 src/content/wiki/players/index.mdx
delete mode 100644 src/layouts/wiki.astro
create mode 100644 src/layouts/wikiContent.astro
create mode 100644 src/pages/wiki/[...slug].astro
diff --git a/src/content/config.ts b/src/content/config.ts
index 7df7140..7884e30 100644
--- a/src/content/config.ts
+++ b/src/content/config.ts
@@ -1,7 +1,7 @@
import { defineCollection, z } from "astro:content";
const news = defineCollection({
- type: "content",
+ type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
@@ -18,7 +18,7 @@ const news = defineCollection({
});
const wiki = defineCollection({
- type: "content",
+ type: 'content',
schema: z.object({
title: z.string(),
}),
diff --git a/src/content/wiki/players/index.mdx b/src/content/wiki/players/index.mdx
new file mode 100644
index 0000000..34b07ac
--- /dev/null
+++ b/src/content/wiki/players/index.mdx
@@ -0,0 +1,21 @@
+---
+title: "Getting Started"
+---
+
+## Prerequisites
+
+Before you download and install, ensure that you have the latest version of Java installed on your machine.
+
+## Download Links
+
+#### Windows
+
+For Windows, click [here](http://example.com/windows) to download.
+
+#### MacOS
+
+For MacOS, click [here](http://example.com/macos) to download.
+
+#### Linux
+
+For Linux, click [here](http://example.com/linux) to download.
\ No newline at end of file
diff --git a/src/layouts/wiki.astro b/src/layouts/wiki.astro
deleted file mode 100644
index 4ede72a..0000000
--- a/src/layouts/wiki.astro
+++ /dev/null
@@ -1,29 +0,0 @@
----
-import Footer from "@component/footer.astro";
-import Head from "@component/head.astro";
-import Header from "@component/header.astro";
-
-import { twMerge } from "tailwind-merge";
-import "../styles/style.css";
-
-export interface Props {
- title?: string;
- className?: string;
-}
-const { title, className } = Astro.props;
----
-
-
-
-
-
-
-
diff --git a/src/layouts/wikiContent.astro b/src/layouts/wikiContent.astro
new file mode 100644
index 0000000..7c1376a
--- /dev/null
+++ b/src/layouts/wikiContent.astro
@@ -0,0 +1,29 @@
+---
+import Footer from "@component/footer.astro";
+import Head from "@component/head.astro";
+import Header from "@component/header.astro";
+
+import { twMerge } from "tailwind-merge";
+import "../styles/style.css";
+
+export interface Props {
+ className?: string;
+}
+const { title } = Astro.props;
+---
+
+
+
+
+
{title}
+
+
+
diff --git a/src/pages/wiki/[...slug].astro b/src/pages/wiki/[...slug].astro
new file mode 100644
index 0000000..98cfa5d
--- /dev/null
+++ b/src/pages/wiki/[...slug].astro
@@ -0,0 +1,21 @@
+---
+import { getCollection } from "astro:content";
+import WikiContent from "../../layouts/wikiContent.astro";
+import type { CollectionEntry } from "astro:content";
+
+export async function getStaticPaths() {
+ const wikis = await getCollection("wiki");
+ return wikis.map((wiki) => ({
+ params: { slug: wiki.slug },
+ props: wiki,
+ }));
+}
+type Props = CollectionEntry<"wiki">;
+
+const post = Astro.props;
+const { Content } = await post.render();
+---
+
+
+
+
diff --git a/src/pages/wiki/index.astro b/src/pages/wiki/index.astro
index a9c5eba..579c9b9 100644
--- a/src/pages/wiki/index.astro
+++ b/src/pages/wiki/index.astro
@@ -1,7 +1,26 @@
---
-import Layout from "../../layouts/wiki.astro";
+import { getCollection } from "astro:content";
+import Layout from "../../layouts/layout.astro";
+const wikiContent = await getCollection("wiki");
---
Welcome to TeaClent Wiki
+
+ This is the official documentation for TeaClent for both Players &
+ Developers
+
+