diff --git a/config/navbar-links.json b/config/navbar-links.json new file mode 100644 index 00000000..136921f3 --- /dev/null +++ b/config/navbar-links.json @@ -0,0 +1,9 @@ +{ + "links": [ + { + "href": "https://github.com/AElfProject/AElf", + "label": "GitHub", + "position": "right" + } + ] +} diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 2b37ee3d..2d2da908 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -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", @@ -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", diff --git a/static/admin/config.yml b/static/admin/config.yml index afb960f4..8aee2d0f 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -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} \ No newline at end of file + - {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} \ No newline at end of file