From 13ae4013632bd45aeb00987df9d6535609d353cd Mon Sep 17 00:00:00 2001 From: OLIMINATOR Date: Tue, 3 Jan 2023 19:18:39 +0100 Subject: [PATCH] nav changes --- src/components/widgets/docs/Sidebar.astro | 44 ++++++++++--------- src/layouts/docs/ItemLayout.astro | 14 +++--- src/pages/docs/index.astro | 4 +- .../docs/items/{x => nadpis}/introduction.md | 0 src/pages/docs/items/{x => nadpis}/test.md | 0 5 files changed, 33 insertions(+), 29 deletions(-) rename src/pages/docs/items/{x => nadpis}/introduction.md (100%) rename src/pages/docs/items/{x => nadpis}/test.md (100%) diff --git a/src/components/widgets/docs/Sidebar.astro b/src/components/widgets/docs/Sidebar.astro index 6322d79..6e07869 100644 --- a/src/components/widgets/docs/Sidebar.astro +++ b/src/components/widgets/docs/Sidebar.astro @@ -1,13 +1,13 @@ --- import type { MarkdownInstance } from "astro"; -const files = await Astro.glob('../../../pages/docs/items/**/*.md'); +const files = await Astro.glob("../../../pages/docs/items/**/*.md"); for (let i = 0; i < 100; i++) { files.push(files[0]); } const sections = files.reduce((acc, file) => { - const category: string = file.url!.split('/')[3]; + const category: string = file.url!.split("/")[3]; if (!acc[category]) acc[category] = []; @@ -20,24 +20,28 @@ const categories = Object.keys(sections); --- \ No newline at end of file + diff --git a/src/layouts/docs/ItemLayout.astro b/src/layouts/docs/ItemLayout.astro index bf7bc0a..5b7e85a 100644 --- a/src/layouts/docs/ItemLayout.astro +++ b/src/layouts/docs/ItemLayout.astro @@ -2,16 +2,16 @@ import Container from "../../components/atoms/Container.astro"; import Sidebar from "../../components/widgets/docs/Sidebar.astro"; import Navbar from "../../components/widgets/Navbar.astro"; -import Layout from "../../layouts/Layout.astro" +import Layout from "../../layouts/Layout.astro"; export interface Props { - content: { - title: string; - }; + content: { + title: string; + }; } const { - content: { title }, + content: { title }, } = Astro.props; --- @@ -25,10 +25,10 @@ const {

{title}

- +
- \ No newline at end of file + diff --git a/src/pages/docs/index.astro b/src/pages/docs/index.astro index 6ed9c17..7ecae01 100644 --- a/src/pages/docs/index.astro +++ b/src/pages/docs/index.astro @@ -1,3 +1,3 @@ \ No newline at end of file + window.location.pathname = "/docs/items/nadpis/introduction"; + diff --git a/src/pages/docs/items/x/introduction.md b/src/pages/docs/items/nadpis/introduction.md similarity index 100% rename from src/pages/docs/items/x/introduction.md rename to src/pages/docs/items/nadpis/introduction.md diff --git a/src/pages/docs/items/x/test.md b/src/pages/docs/items/nadpis/test.md similarity index 100% rename from src/pages/docs/items/x/test.md rename to src/pages/docs/items/nadpis/test.md