Skip to content

Commit

Permalink
feat: hide_navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
lino-levan committed Aug 11, 2023
1 parent 3f72898 commit a6f2581
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
9 changes: 5 additions & 4 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"tasks": {
"install": "deno run -Ar install.ts ."
"install": "deno run -Ar install.ts .",
"dev": "cd www && pyro dev"
},
"imports": {
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"preact-render-to-string": "https://esm.sh/*[email protected]",
"std/": "https://deno.land/std@0.197.0/",
"std/": "https://deno.land/std@0.198.0/",
"gfm": "https://deno.land/x/[email protected]/mod.ts",
"icons/": "https://deno.land/x/[email protected]/tsx/",
"pngs": "https://deno.land/x/[email protected]/mod.ts",
Expand All @@ -17,8 +18,8 @@
"cliffy": "https://deno.land/x/[email protected]/command/mod.ts",
"esbuild": "https://deno.land/x/[email protected]/mod.js",
"esbuild_deno_loader": "https://deno.land/x/[email protected]/mod.ts",
"@unocss/core": "https://esm.sh/@unocss/[email protected].1",
"@unocss/preset-uno": "https://esm.sh/@unocss/[email protected].1"
"@unocss/core": "https://esm.sh/@unocss/[email protected].2",
"@unocss/preset-uno": "https://esm.sh/@unocss/[email protected].2"
},
"compilerOptions": {
"jsx": "react-jsx",
Expand Down
18 changes: 12 additions & 6 deletions src/lib/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,18 @@ export async function page(props: {
header={props.options.header}
github={props.options.config.github}
/>
<div class="flex gap-12 flex-grow bg-white dark:bg-black">
<Sidebar
class="w-64 p-2 border-r border-gray-200 dark:border-gray-700 pt-4 flex flex-col gap-2"
route_map={props.options.route_map}
route={props.options.route}
/>
<div
class={`flex gap-12 flex-grow bg-white dark:bg-black ${
props.options.config.hide_navbar ? "justify-center" : ""
}`}
>
{!props.options.config.hide_navbar && (
<Sidebar
class="w-64 p-2 border-r border-gray-200 dark:border-gray-700 pt-4 flex flex-col gap-2"
route_map={props.options.route_map}
route={props.options.route}
/>
)}
<div class="flex-grow max-w-screen-lg flex flex-col gap-8 py-4 overflow-hidden">
<h1 class="text-5xl font-bold text-gray-800 dark:text-gray-100">
{props.page.title}
Expand Down
1 change: 1 addition & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface Config {
copyright?: string;
header?: { left?: string[]; right?: string[] };
footer?: Record<string, string[]>;
hide_navbar?: boolean;
plugins?: string[];
}

Expand Down
3 changes: 3 additions & 0 deletions www/pages/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ footer:
- Discord https://discord.gg/XJMMSSC4Fj
- Support https://github.com/lino-levan/pyro/issues/new

# Hide the navigation bar on the left from rendering (optional)
hide_navbar: true

# Any plugins you want to be used (optional)
plugin:
- https://deno.land/x/pyro/plugins/demo.tsx
Expand Down
2 changes: 1 addition & 1 deletion www/pyro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ footer:
- Installation /getting-started/installation
Community:
- Discord https://discord.gg/XJMMSSC4Fj
- Support https://github.com/lino-levan/pyro/issues/new
- Support https://github.com/lino-levan/pyro/issues/new

0 comments on commit a6f2581

Please sign in to comment.