mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 08:19:07 +02:00
feat: allow using pure HTML as label in navbar links (#7079)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
529d853ab8
commit
bfbc78e52a
5 changed files with 63 additions and 27 deletions
|
@ -259,6 +259,7 @@ Accepted fields:
|
|||
| --- | --- | --- | --- |
|
||||
| `type` | `'default'` | Optional | Sets the type of this item to a link. |
|
||||
| `label` | `string` | **Required** | The name to be shown for this item. |
|
||||
| `html` | `string` | Optional | Same as `label`, but renders pure HTML instead of text content. |
|
||||
| `to` | `string` | **Required** | Client-side routing, used for navigating within the website. The baseUrl will be automatically prepended to this value. |
|
||||
| `href` | `string` | **Required** | A full-page navigation, used for navigating outside of the website. **Only one of `to` or `href` should be used.** |
|
||||
| `prependBaseUrlToHref` | `boolean` | `false` | Prepends the baseUrl to `href` values. |
|
||||
|
@ -288,6 +289,8 @@ module.exports = {
|
|||
// Only one of "to" or "href" should be used
|
||||
// href: 'https://www.facebook.com',
|
||||
label: 'Introduction',
|
||||
// Only one of "label" or "html" should be used
|
||||
// html: '<b>Introduction</b>'
|
||||
position: 'left',
|
||||
activeBaseRegex: 'docs/(next|v8)',
|
||||
target: '_blank',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue