Skip to content

Commit ebc0953

Browse files
committed
feat: hide edit link by page (close: vuejs#284)
1 parent 31b8feb commit ebc0953

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/default-theme-config/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,14 @@ module.exports = {
321321
}
322322
```
323323

324+
You can also hide the edit link on specific pages via `YAML front matter`:
325+
326+
``` yaml
327+
---
328+
editLink: false
329+
---
330+
```
331+
324332
## Simple CSS Override
325333

326334
If you wish to apply simple overrides to the styling of the default theme, you can create an `.vuepress/override.styl` file. This is a [Stylus](http://stylus-lang.com/) file but you can use normal CSS syntax as well.

lib/default-theme/Page.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export default {
5959
docsBranch = 'master',
6060
docsRepo = repo
6161
} = this.$site.themeConfig
62+
const hideEditLink = this.$page.frontmatter.editLink === false
6263
6364
let path = normalize(this.$page.path)
6465
if (endingSlashRE.test(path)) {
@@ -67,7 +68,7 @@ export default {
6768
path += '.md'
6869
}
6970
70-
if (docsRepo && editLinks) {
71+
if (docsRepo && editLinks && !hideEditLink) {
7172
const base = outboundRE.test(docsRepo)
7273
? docsRepo
7374
: `https://github.com/${docsRepo}`

0 commit comments

Comments
 (0)