在我的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',
},
],
},我想将导航栏标题的链接从https://docs.utili.xyz/更改为https://docs.utili.xyz/docs。我怎么能这样做呢?我尝试添加一个href值,但是在构建时,我被告知它是无效的。
我正在使用Docusaurus 2。
发布于 2021-05-18 03:39:55
虽然来晚了,但documentation实际上指明了正确的方向,尽管这可能有点令人费解。诀窍是设置logo属性的href字段。该字段实际上绑定到标题本身的链接(尽管标题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).
},我不知道如何在不显示徽标的情况下设置标题。
https://stackoverflow.com/questions/66164007
复制相似问题