Skip to content

Commit 38fc81f

Browse files
committed
docs: add example configuration for encrypting entire directory and specific pages
1 parent c254ef3 commit 38fc81f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/.vuepress/theme.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,22 @@ export default hopeTheme(
189189
sorter: (a, b) => Number(b.frontmatter.date) - Number(a.frontmatter.date),
190190
},
191191
},
192+
// https://theme-hope.vuejs.press/zh/guide/feature/encrypt.html
193+
// 加密配置样例(不需要可删除)注意,受到 VuePress 的限制,在未解密前,文章内容仅仅被隐藏,访问者仍可以从源码中获取文章的内容。
194+
encrypt: {
195+
config: {
196+
// 这会加密整个 encrypt 目录,并且两个密码都是可用的
197+
"/encrypt/": {
198+
password: ["1234", "5678"],
199+
hint: "从 xxx 获取密码",
200+
},
201+
// 这只会加密 /apps/encrypt03.html 页面
202+
"/apps/encrypt03.html": {
203+
password: "1234",
204+
hint: "从 xxx 获取密码",
205+
},
206+
},
207+
},
192208

193209
// 开发模式下是否启动热更新,显示所有更改并重新渲染
194210
hotReload: true,

0 commit comments

Comments
 (0)