mirror of
https://github.com/xHyroM/website.git
synced 2024-11-22 15:01:05 +01:00
nav changes
This commit is contained in:
parent
3ff512f8e4
commit
13ae401363
5 changed files with 33 additions and 29 deletions
|
@ -1,13 +1,13 @@
|
||||||
---
|
---
|
||||||
import type { MarkdownInstance } from "astro";
|
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++) {
|
for (let i = 0; i < 100; i++) {
|
||||||
files.push(files[0]);
|
files.push(files[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const sections = files.reduce((acc, file) => {
|
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] = [];
|
if (!acc[category]) acc[category] = [];
|
||||||
|
|
||||||
|
@ -20,24 +20,28 @@ const categories = Object.keys(sections);
|
||||||
---
|
---
|
||||||
|
|
||||||
<aside aria-label="Sidebar">
|
<aside aria-label="Sidebar">
|
||||||
<nav class="w-full mr-4 py-4 bg-gray-50 dark:bg-gray-800">
|
<nav class="w-full mr-16 py-4">
|
||||||
<ul class="overflow-y-auto overflow-x-visible">
|
<ul class="overflow-y-auto overflow-x-visible">
|
||||||
{categories.map((category) =>
|
{
|
||||||
<li>
|
categories.map((category) => (
|
||||||
<div class="pt-5">
|
<li>
|
||||||
<h1 class="text-white text-2xl w-full font-extrabold">{category}</h1>
|
<div class="pt-5">
|
||||||
<ul>
|
<h1 class="text-white text-2xl w-full font-extrabold ">
|
||||||
{sections[category].map((section) =>
|
{category}
|
||||||
<li class="text-white w-full my-2 pl-4 hover:bg-white/20 p-2">
|
</h1>
|
||||||
<a href={section.url}>
|
<ul>
|
||||||
{section.frontmatter.title}
|
{sections[category].map((section) => (
|
||||||
</a>
|
<li class="text-white my-2 hover:bg-white/20 rounded-sm p-2 transition-colors duration-150">
|
||||||
</li>
|
<a href={section.url} class="px-4">
|
||||||
)}
|
{section.frontmatter.title}
|
||||||
</ul>
|
</a>
|
||||||
</div>
|
</li>
|
||||||
</li>
|
))}
|
||||||
)}
|
</ul>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</aside>
|
</aside>
|
|
@ -2,16 +2,16 @@
|
||||||
import Container from "../../components/atoms/Container.astro";
|
import Container from "../../components/atoms/Container.astro";
|
||||||
import Sidebar from "../../components/widgets/docs/Sidebar.astro";
|
import Sidebar from "../../components/widgets/docs/Sidebar.astro";
|
||||||
import Navbar from "../../components/widgets/Navbar.astro";
|
import Navbar from "../../components/widgets/Navbar.astro";
|
||||||
import Layout from "../../layouts/Layout.astro"
|
import Layout from "../../layouts/Layout.astro";
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
content: {
|
content: {
|
||||||
title: string;
|
title: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
content: { title },
|
content: { title },
|
||||||
} = Astro.props;
|
} = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<script>
|
<script>
|
||||||
window.location.pathname = "/docs/items/x/introduction";
|
window.location.pathname = "/docs/items/nadpis/introduction";
|
||||||
</script>
|
</script>
|
Loading…
Reference in a new issue