页脚
当存在 themeConfig.footer
时,VitePress 将在页面底部显示全局页脚。
ts
export default {
themeConfig: {
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2019-present Evan You'
}
}
}
ts
export interface Footer {
// The message shown right before copyright.
message?: string
// The actual copyright text.
copyright?: string
}
上述配置还支持 HTML 字符串。因此,例如,如果您想配置页脚文本有一些链接,您可以按如下方式调整配置:
ts
export default {
themeConfig: {
footer: {
message: 'Released under the <a href="https://github.com/vuejs/vitepress/blob/main/LICENSE">MIT License</a>.',
copyright: 'Copyright © 2019-present <a href="https://github.com/yyx990803">Evan You</a>'
}
}
}
WARNING
只有内联元素可以在message
和copyright
中使用,因为它们在<p>
元素内呈现。如果您想添加块元素,请考虑使用 layout-bottom
插槽。
请注意,当 SideBar 可见时,页脚将不会显示。
Frontmatter 配置
可以通过在frontmatter上使用footer
选项来在每个页面上禁用这个功能。
yaml
---
footer: false
---