fix($theme-default): Fix editLink on specific page (#1825)

This commit is contained in:
Patryk Niedźwiedziński
2019-09-20 09:25:12 +02:00
committed by Franck Abgrall
parent 2fcacb4c3d
commit 0e8a442faf
@@ -12,6 +12,7 @@
</footer>
</template>
<script>
import isNil from 'lodash/isNil'
import { endingSlashRE, outboundRE } from '../util'
export default {
@@ -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,