From d46819c497e51734316dd6f18641c1695443c032 Mon Sep 17 00:00:00 2001 From: aaron hendrick Date: Fri, 27 Apr 2018 17:57:11 -0700 Subject: [PATCH] feat: hide edit link by page (close: #284) (#286) --- docs/default-theme-config/README.md | 8 ++++++++ lib/default-theme/Page.vue | 3 +++ 2 files changed, 11 insertions(+) diff --git a/docs/default-theme-config/README.md b/docs/default-theme-config/README.md index 4f525316df..8a2ea09f6e 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 a specific page 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..ea03b3ff19 100644 --- a/lib/default-theme/Page.vue +++ b/lib/default-theme/Page.vue @@ -52,6 +52,9 @@ export default { } }, editLink () { + if (this.$page.frontmatter.editLink === false) { + return + } const { repo, editLinks,