Skip to content

Commit

Permalink
fix($theme-default): Fix editLink on specific page (#1825)
Browse files Browse the repository at this point in the history
  • Loading branch information
pniedzwiedzinski authored and kefranabg committed Sep 20, 2019
1 parent 2fcacb4 commit 0e8a442
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/@vuepress/theme-default/components/PageEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</footer>
</template>
<script>
import isNil from 'lodash/isNil'
import { endingSlashRE, outboundRE } from '../util'
export default {
Expand All @@ -32,18 +33,18 @@ export default {
},
editLink () {
if (this.$page.frontmatter.editLink === false) {
return
}
const showEditLink = isNil(this.$page.frontmatter.editLink)
? this.$site.themeConfig.editLinks
: this.$page.frontmatter.editLink
const {
repo,
editLinks,
docsDir = '',
docsBranch = 'master',
docsRepo = repo
} = this.$site.themeConfig
if (docsRepo && editLinks && this.$page.relativePath) {
if (showEditLink && docsRepo && this.$page.relativePath) {
return this.createEditLink(
repo,
docsRepo,
Expand Down

0 comments on commit 0e8a442

Please sign in to comment.