水印
小于 1 分钟
VuePress Theme Hope 允许你通过 @vuepress/plugin-watermark 添加水印。
介绍
要使用它,先安装 @vuepress/plugin-watermark:
pnpm
pnpm add -D @vuepress/plugin-watermark@nextyarn
yarn add -D @vuepress/plugin-watermark@nextnpm
npm i -D @vuepress/plugin-watermark@next你可以通过在主题选项中设置 plugins.watermark 或在页面 Frontmatter 中设置 watermark 来自定义水印行为。
最简单的方法是将其设置为 true 以获取站点名称水印:
全局启用:
import {hopeTheme} from "vuepress-theme-hope"; export defaulthopeTheme({plugins: {watermark: true, }, });在特定页面启用:
--- watermark: true ---
你也可以完全自定义水印:
全局自定义:
import {hopeTheme} from "vuepress-theme-hope"; export defaulthopeTheme({plugins: {watermark: {watermarkOptions: {content: "自定义内容",movable: true, // 其他选项 }, }, }, });自定义某个页面:
--- watermark: width: 200 height: 200 content: Your content opacity: 0.5 ---
有关详细的配置,请参见 水印插件文档。
更新日志
2025/10/31 04:44
查看所有更新日志
85b23-于7bad1-于9e7b3-于253d1-于bdfcb-于04b1b-于cc7db-于