diff --git a/docs/default-theme-config/README.md b/docs/default-theme-config/README.md index 4f525316df..494be29af7 100644 --- a/docs/default-theme-config/README.md +++ b/docs/default-theme-config/README.md @@ -321,6 +321,14 @@ module.exports = { } ``` +You can also hide the edit link on specific pages via `YAML front matter`: + +``` yaml +--- +editLink: false +--- +``` + ## Simple CSS Override 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. diff --git a/lib/default-theme/Page.vue b/lib/default-theme/Page.vue index cb28803e36..5887fafa08 100644 --- a/lib/default-theme/Page.vue +++ b/lib/default-theme/Page.vue @@ -59,6 +59,7 @@ export default { docsBranch = 'master', docsRepo = repo } = this.$site.themeConfig + const hideEditLink = this.$page.frontmatter.editLink === false let path = normalize(this.$page.path) if (endingSlashRE.test(path)) { @@ -67,7 +68,7 @@ export default { path += '.md' } - if (docsRepo && editLinks) { + if (docsRepo && editLinks && !hideEditLink) { const base = outboundRE.test(docsRepo) ? docsRepo : `https://github.com/${docsRepo}`