230*_*iel 1 configuration docusaurus
在我的 docusaurus.config.js 文件中,我有以下内容定义了导航栏的内容:
navbar: {
title: 'Utili Documentation',
logo: {
alt: 'Utili Logo',
src: 'https://file.utili.xyz/UtiliSmall.png',
},
items: [
{
href: 'https://utili.xyz/',
label: 'Utili',
position: 'right',
},
{
href: 'https://github.com/230Daniel/UtiliDocs/',
label: 'GitHub',
position: 'right',
},
],
},
Run Code Online (Sandbox Code Playgroud)
我想将导航栏标题的链接从https://docs.utili.xyz/更改为https://docs.utili.xyz/docs。我怎么能这样做呢?我尝试添加 href 值,但是在构建时我被告知它无效。
我正在使用 Docusaurus 2。
小智 5
虽然迟到了,但文档实际上显示了正确的方法,尽管它可能有点令人困惑。诀窍是设置属性href的字段logo。该字段实际上绑定到标题本身的链接(尽管不能直接设置标题 href)。引用文档,他的解决方案可能是
logo: {
alt: 'Utili Logo',
src: 'https://file.utili.xyz/UtiliSmall.png'
href: 'https://docs.utili.xyz/docs', // Default to `siteConfig.baseUrl`.
target: '_self', // By default, this value is calculated based on the `href` attribute (the external link will open in a new tab, all others in the current one).
},
Run Code Online (Sandbox Code Playgroud)
我不知道如何在不显示徽标的情况下设置标题。
| 归档时间: |
|
| 查看次数: |
1661 次 |
| 最近记录: |