Skip to content

Commit

Permalink
feat: hide edit link by page (close: vuejs#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
achendrick committed Apr 27, 2018
1 parent 31b8feb commit ebc0953
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/default-theme-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion lib/default-theme/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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}`
Expand Down

0 comments on commit ebc0953

Please sign in to comment.