Skip to content

Commit

Permalink
feat: navbar links
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Jun 19, 2024
1 parent 63e8cca commit 5f17a70
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
9 changes: 9 additions & 0 deletions config/navbar-links.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"links": [
{
"href": "https://github.com/AElfProject/AElf",
"label": "GitHub",
"position": "right"
}
]
}
16 changes: 3 additions & 13 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import footerLinks from "./config/footer-links.json";
import navbarLinks from "./config/navbar-links.json";

const config: Config = {
title: "AELF Docs",
Expand Down Expand Up @@ -59,19 +60,8 @@ const config: Config = {
alt: "aelf",
src: "img/Logo.aelf.svg",
},
items: [
{
type: "docSidebar",
sidebarId: "tutorialSidebar",
position: "left",
label: "Docs",
},
{
href: "https://github.com/AElfProject/AElf",
label: "GitHub",
position: "right",
},
],
// @ts-expect-error
items: navbarLinks.links,
},
footer: {
style: "light",
Expand Down
15 changes: 14 additions & 1 deletion static/admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,17 @@ collections:
fields:
- {label: Label, name: label, widget: string}
- {label: Href, name: href, widget: string}
- {label: Icon, name: icon, widget: image, allow_multiple: false, required: false}
- {label: Icon, name: icon, widget: image, allow_multiple: false, required: false}
- label: "Navbar Links"
name: "navbarlinks"
file: "config/navbar-links.json"
fields:
- label: Links
name: links
widget: list
collapsed: false
fields:
- {label: Label, name: label, widget: string}
- {label: To, name: to, widget: string, required: false}
- {label: Href, name: href, widget: string, required: false}
- {label: Position, name: position, widget: select, options: [left, right], default: left}

0 comments on commit 5f17a70

Please sign in to comment.