页脚
当 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>'
}
}
}警告
message 和 copyright 中只能使用内联元素,因为它们是在 <p> 元素内渲染的。如果你想添加块级元素,请考虑使用 layout-bottom 插槽。
请注意,当 侧边栏 可见时,页脚将不会显示。
前置信息配置
这可以通过在 frontmatter 上使用 footer 选项来禁用每个页面。
yaml
---
footer: false
---