頁尾
當 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 設定
這可以使用 Frontmatter 上的 footer
選項逐頁停用
yaml
---
footer: false
---