You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vitepress/docs/zh/reference/default-theme-footer.md

1.1 KiB

页脚

配置好 themeConfig.footer VitePress 将在全局页面底部显示页脚。

export default {
	themeConfig: {
		footer: {
			message: 'Released under the MIT License.',
			copyright: 'Copyright © 2019-present Evan You',
		},
	},
}
export interface Footer {
	// The message shown right before copyright.
	message?: string

	// The actual copyright text.
	copyright?: string
}

上面的配置也支持 HTML 字符串。所以,例如,如果你想配置页脚文本有一些链接,你可以调整配置如下:

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 警告 只有内联元素可以在 messagecopyright 中使用,因为它们在 <p> 元素。如果要添加块元素,请考虑改用 layout-bottom 插槽。 :::

请注意,当侧边栏可见时,不会显示页脚。