diff --git a/LICENSE b/LICENSE index 5295685..281d7f3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Jane Doe +Copyright (c) 2024 Jane Doe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/config/config.ts b/src/config/config.ts deleted file mode 100644 index 547b636..0000000 --- a/src/config/config.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const SIDEBAR = [ - { text: "Get Started", header: true }, - { text: "Installation", link: "/docs/get-started/installation" }, - { text: "Introduction", link: "/docs/get-started/introduction" }, - - { text: "Guides", header: true }, - { text: "Migrate from Z", link: "docs/guides/intrmigrate-from-z" }, - - { text: "Tutorials", header: true }, - { text: "Build X", link: "docs/tutorials/build-x" }, -]; diff --git a/src/config/docs.json b/src/config/docs.json index 3a95fb6..c7c93b0 100644 --- a/src/config/docs.json +++ b/src/config/docs.json @@ -1,12 +1,32 @@ { - "Get Started": [ - "/docs/get-started/introduction/", - "/docs/get-started/installation/" - ], - "Tutorials": [ - "/docs/tutorials/build-x/" - ], - "Guides": [ - "/docs/guides/migrate-from-z/" + "main": [ + { + "text": "Get Started", + "header": true + }, + { + "text": "Installation", + "link": "/docs/get-started/installation" + }, + { + "text": "Introduction", + "link": "/docs/get-started/introduction" + }, + { + "text": "Guides", + "header": true + }, + { + "text": "Migrate from Z", + "link": "/docs/guides/migrate-from-z" + }, + { + "text": "Tutorials", + "header": true + }, + { + "text": "Build X", + "link": "/docs/tutorials/build-x" + } ] } diff --git a/src/content/terms/-index.md b/src/content/terms/-index.md index e9e01a2..27988f3 100644 --- a/src/content/terms/-index.md +++ b/src/content/terms/-index.md @@ -6,7 +6,7 @@ draft: false ## Copyright -© 2023 Jane Doe. All rights reserved. +© 2024 Jane Doe. All rights reserved. ## Reuse @@ -17,7 +17,7 @@ The source code for janedoe.com is protected under the MIT License. In short, yo ```md The MIT License (MIT) -Copyright (c) 2023 Jane Doe +Copyright (c) 2024 Jane Doe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -54,7 +54,7 @@ This source code is derivative of [pages](https://github.com/reednel/pages) by [ ```md The MIT License (MIT) -Copyright (c) 2023 Reed Nelson +Copyright (c) 2024 Reed Nelson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/layouts/DocsSingle.astro b/src/layouts/DocSingle.astro similarity index 56% rename from src/layouts/DocsSingle.astro rename to src/layouts/DocSingle.astro index ef47dc7..e27a9be 100644 --- a/src/layouts/DocsSingle.astro +++ b/src/layouts/DocSingle.astro @@ -1,14 +1,11 @@ --- import DocBrowser from '@/components/DocBrowser.astro'; import DocContents from '@/components/DocContents.astro'; -import Share from "@/components/Share.astro"; -import config from "@/config/config.json"; const { post } = Astro.props; const { Content, headings } = await post.render(); const { title } = post.data; const currentPage = new URL(Astro.request.url).pathname; -const { docs_folder } = config.settings; ---
@@ -16,29 +13,19 @@ const { docs_folder } = config.settings;
-
+
-
- - -
-
-
Share :
- -
+
+

{ title }

+
+
-
+
diff --git a/src/layouts/components/DocBrowser.astro b/src/layouts/components/DocBrowser.astro index 2e07f46..b24faab 100644 --- a/src/layouts/components/DocBrowser.astro +++ b/src/layouts/components/DocBrowser.astro @@ -1,44 +1,58 @@ --- -import { SIDEBAR } from '@/config/config.ts'; +import docs from "@/config/docs.json"; const { currentPage } = Astro.props; const currentPageMatch = currentPage.slice(1); const isCurrentPage = (item) => { - if (item.link) { - return item.link.includes(currentPageMatch); - } - return false; + if (item.link) { + return item.link.includes(currentPageMatch); + } + return false; }; const getLinkClasses = (link) => { - const baseClasses = "block py-2 px-6 my-1 transition-colors border-l hover:border-slate-400 text-slate-500 hover:text-slate-900" + const baseClasses = + "block py-2 px-6 my-1 transition-colors border-l hover:border-slate-400 text-slate-500 hover:text-slate-900"; - if (isCurrentPage(link)) { - return baseClasses + " border-slate-500 text-slate-900"; - } else { - return baseClasses; - } + if (isCurrentPage(link)) { + return baseClasses + " border-slate-500 text-slate-900"; + } else { + return baseClasses; + } +}; + +export interface doc_data { + text: string; + header?: boolean; + link?: string; } + +const { main }: { main: doc_data[] } = docs; --- - + + - diff --git a/src/layouts/components/DocContents.astro b/src/layouts/components/DocContents.astro index c1172ed..ec29fd5 100644 --- a/src/layouts/components/DocContents.astro +++ b/src/layouts/components/DocContents.astro @@ -1,48 +1,33 @@ --- - const { headings } = Astro.props; +const { headings } = Astro.props; --- - diff --git a/src/layouts/components/Footer.astro b/src/layouts/components/Footer.astro index 0b4857c..d8ca27c 100644 --- a/src/layouts/components/Footer.astro +++ b/src/layouts/components/Footer.astro @@ -9,7 +9,7 @@ import social from "@/config/social.json"; diff --git a/src/pages/docs/[...id].astro b/src/pages/docs/[...id].astro index 3edfb6d..49b9166 100644 --- a/src/pages/docs/[...id].astro +++ b/src/pages/docs/[...id].astro @@ -1,11 +1,11 @@ --- import Base from "@/layouts/Base.astro"; -import DocsSingle from "@/layouts/DocsSingle.astro"; +import DocSingle from "@/layouts/DocSingle.astro"; import { getSinglePage } from "@/lib/contentParser.astro"; -import { getCollection } from 'astro:content'; +import config from "@/config/config.json"; export async function getStaticPaths() { - const docs = await getCollection('docs'); + const docs = await getSinglePage(config.settings.docs_folder); return docs.map(post => ({ params: { id: post.slug }, props: { post }, @@ -20,5 +20,5 @@ const { title } = post.data; title={title} meta_title={title} > - +