Skip to content

Commit

Permalink
bug fixed and content updated
Browse files Browse the repository at this point in the history
  • Loading branch information
HYP3R00T committed Jul 31, 2024
1 parent 4d39f42 commit 289888b
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 22 deletions.
7 changes: 5 additions & 2 deletions .vscode/doc.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
"title: $1",
"author: hyperoot",
"pubDatetime: $2 #2024-04-09T12:00:00-05:30",
"# modDatetime:''",
"# description:''",
"# modDatetime: ''",
"# description: ''",
"draft: true",
"#tags:",
"#- tag1",
"#hide_toc: ",
"#hide_sidenav: ",
"#hide_breadcrumbs: ",
"---",
],
"description": "Docs template"
Expand Down
11 changes: 0 additions & 11 deletions .vscode/launch.json

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@
"[astro]": {
"editor.defaultFormatter": "astro-build.astro-vscode"
},
"yaml.schemas": {
"https://json.schemastore.org/github-action.json": "file:///home/hyperoot/dev/projects/CelestialDocs/.github/workflows/deploy.yml"
}
}
2 changes: 1 addition & 1 deletion config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const SITE = {
website: "https://hyperoot.dev", // replace this with your deployed domain
author: "HYP3R00T",
desc: "Documentation theme using Astro and Shadcn",
title: "Celestial Docs",
title: "CelestialDocs",
ogImage: "og-image.jpg",
repo: "https://github.com/HYP3R00T/CelestialDocs",
};
Expand Down
5 changes: 4 additions & 1 deletion src/components/core/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Search as SearchIcon } from "lucide-react";

import type { DocsEntry } from "@/lib/types";
import { capitalizeFirstLetter } from "@/lib/utils";
import { menu_items } from "config";

const docs: DocsEntry[] = await getCollection("docs");

Expand Down Expand Up @@ -68,6 +69,8 @@ export function Search() {
return () => document.removeEventListener("keydown", down);
}, []);

console.log(results);

return (
<div className="">
<Dialog open={open} onOpenChange={setOpen}>
Expand Down Expand Up @@ -95,7 +98,7 @@ export function Search() {
key={refIndex}
>
<a
href={item.slug}
href={`/${item.slug}`}
key={refIndex}
className=" no-underline hover:text-primary-foreground"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/docs/SideNavMenu.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const { class: className } = Astro.props;
? capitalizeFirstLetter(item.title)
: capitalizeFirstLetter(item.slug.split("/").pop() || "");
const className = `
${level === 0 ? "font-bold" : "font-light"}
${level === 0 ? "font-bold" : "font-normal"}
${pathname === "/" + item.slug ? "text-primary" : "no-underline"}
`.trim();
return (
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/Guides/breadcrumbs.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Breadcrumbs
---
By default, CelestialDocs sites supports breadcrumbs. It is generated after fetching the folder structure of `docs` folder.
By default, CelestialDocs sites supports breadcrumbs. It is generated after scanning the folder structure of `docs` folder.

## Hide breadcrumbs

Expand Down
1 change: 1 addition & 0 deletions src/content/docs/Guides/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ title: Guides
---

- [Breadcrumbs](/guides/breadcrumbs)
- [Sidebar Navigation](/guides/sidebar-navigation)
- [Site Search](/guides/site-search)
- [Table of Contents](/guides/table-of-contents)
45 changes: 45 additions & 0 deletions src/content/docs/Guides/sidebar-navigation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Sidebar Navigation
---
By default, CelestialDocs sites include sidebar navigation. It is generated after parsing the folder structure of `docs` folder.

## Custom order

By default, it will order the top-level items (folders and files that are immediately inside the `docs` folder) alphabetically. But we can provide a custom order to the top level items.

In `config.js` you can set `side_nav_menu_order` with an order of items. Mind that the type is an array of strings. Each string is just the `slug` of that page.

```js
// config.js

export const side_nav_menu_order: string[] = ["getting-started", "guides"];
// getting-started.mdx (file)
// guides (folder)
```

You can include `folder-name`, `md` & `mdx` files. If you don't order every items, then the left out folders and files will the ordered after that. Don't add extensions for `md` & `mdx` files.

## Hide Sidebar Navigation

### Hide globally

In `config.js`, you can hide sidebar navigation by keeping the value of `hide_side_navinations` as `true`. This will hide the sidebar navigation for all pages.

```js
// config.js

export const docconfig = {
...
hide_side_navinations: true,
...
};
```

### Hide locally

To hide sidebar navigation for specific pages only, then add `hide_sidenav` in the frontmatter as `true`.
```
---
hide_sidenav: true
---
```
1 change: 0 additions & 1 deletion src/content/docs/Guides/table-of-contents.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Table of Contents

---
import Callout from "@/components/Callout.astro";

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ hide_breadcrumbs: true
---
import Callout from "@/components/Callout.astro";

_CelestialDocs_ is a documentation theme built on top of the [Astro](https://astro.build/) framework. This guide will help you get started with a new project.
**_Celestial Docs_** is a documentation theme built on top of the [Astro](https://astro.build/) framework. This guide will help you get started with a new project.

## Create a new project

Expand Down

0 comments on commit 289888b

Please sign in to comment.