mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-24 03:58:49 +02:00
feat(theme-classic): new 'html' type navbar item (#7058)
* feat(theme-classic): allow using html in dropdown items * Fix tests * Introduce HTML type for navbar item * Update packages/docusaurus-theme-classic/src/theme/NavbarItem/HtmlNavbarItem.tsx Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com> Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com> Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
5273a534d3
commit
84d04ed6ed
8 changed files with 135 additions and 1 deletions
|
@ -419,6 +419,15 @@ const config = {
|
|||
position: 'right',
|
||||
dropdownActiveClassDisabled: true,
|
||||
dropdownItemsAfter: [
|
||||
{
|
||||
type: 'html',
|
||||
value: '<hr class="dropdown-separator">',
|
||||
},
|
||||
{
|
||||
type: 'html',
|
||||
className: 'dropdown-archived-versions',
|
||||
value: '<b>Archived versions</b>',
|
||||
},
|
||||
...ArchivedVersionsDropdownItems.map(
|
||||
([versionName, versionUrl]) => ({
|
||||
label: versionName,
|
||||
|
@ -429,6 +438,10 @@ const config = {
|
|||
href: 'https://v1.docusaurus.io',
|
||||
label: '1.x.x',
|
||||
},
|
||||
{
|
||||
type: 'html',
|
||||
value: '<hr class="dropdown-separator">',
|
||||
},
|
||||
{
|
||||
to: '/versions',
|
||||
label: 'All versions',
|
||||
|
@ -439,6 +452,10 @@ const config = {
|
|||
type: 'localeDropdown',
|
||||
position: 'right',
|
||||
dropdownItemsAfter: [
|
||||
{
|
||||
type: 'html',
|
||||
value: '<hr style="margin: 0.3rem 0;">',
|
||||
},
|
||||
{
|
||||
href: 'https://github.com/facebook/docusaurus/issues/3526',
|
||||
label: 'Help Us Translate',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue