@docusaurus/theme-classic
caution
This section is a work in progress.
Common
Dark mode
To remove the ability to switch on dark mode, there is an option themeConfig.disableDarkMode
, which is implicitly set to false
.
Meta image
You can configure a default image that will be used for your meta tag, in particular og:image
and twitter:image
.
Announcement bar
Sometimes you want to announce something in your website. Just for such a case, you can add an announcement bar. This is a non-fixed and dismissable panel above the navbar.
Navbar
Navbar Title & Logo
You can add a logo and title to the navbar via themeConfig.navbar
. Logo can be placed in static folder. Logo URL is set to base URL of your site by default. Although you can specify your own URL for the logo, if it is an external link, it will open in a new tab. In addition, you can override a value for the target attribute of logo link, it can come in handy if you are hosting docs website in a subdirectory of your main website, and in which case you probably do not need a link in the logo to the main website will open in a new tab.
To improve dark mode support, you can also set a different logo for this mode.
Navbar Links
You can add links to the navbar via themeConfig.navbar.links
:
Outbound links automatically get target="_blank" rel="noopener noreferrer"
attributes.
Navbar Dropdown
Navbar items can also be dropdown items by specifying the items
, an inner array of navbar links.
Auto-hide sticky navbar
You can enable this cool UI feature that automatically hides the navbar when a user starts scrolling down the page, and show it again when the user scrolls up.
Footer
CodeBlock
Docusaurus uses Prism React Renderer to highlight code blocks.
Theme
By default, we use Palenight as syntax highlighting theme. You can specify a custom theme from the list of available themes. If you want to use a different syntax highlighting theme when the site is in dark mode, you may also do so.
Note: If you use the line highlighting Markdown syntax, you might need to specify a different highlight background color for the dark mode syntax highlighting theme. Refer to the docs for guidance.
Default language
You can set a default language for code blocks if no language is added after the opening triple backticks (i.e. ```). Note that a valid language name must be passed, e.g.: