diff --git a/docs/default-theme-config/README.md b/docs/default-theme-config/README.md index 68ae6995a1..daa9b07da9 100644 --- a/docs/default-theme-config/README.md +++ b/docs/default-theme-config/README.md @@ -229,13 +229,16 @@ module.exports = { // Customising the header label // Defaults to "GitHub"/"GitLab"/"Bitbucket" depending on `themeConfig.repo` repoLabel: 'Contribute!', - // if your docs are not at the root of the repo + // If your docs are placed at a different repo + // Default to `themeConfig.repo` + docsRepo: 'vuejs/vuejs.org', + // If your docs are not at the root of the repo docsDir: 'docs', - // optional, defaults to master + // Optional, defaults to master docsBranch: 'master', - // defaults to true, set to false to disable + // Defaults to true, set to false to disable editLinks: true, - // custom text for edit link. Defaults to "Edit this page" + // Custom text for edit link. Defaults to "Edit this page" editLinkText: 'Help us improve this page!' } } diff --git a/lib/default-theme/Page.vue b/lib/default-theme/Page.vue index 029a96f358..d5668e514b 100644 --- a/lib/default-theme/Page.vue +++ b/lib/default-theme/Page.vue @@ -55,7 +55,8 @@ export default { repo, editLinks, docsDir = '', - docsBranch = 'master' + docsBranch = 'master', + docsRepo = repo } = this.$site.themeConfig let path = normalize(this.$page.path) @@ -65,10 +66,10 @@ export default { path += '.md' } - if (repo && editLinks) { - const base = outboundRE.test(repo) - ? repo - : `https://github.com/${repo}` + if (docsRepo && editLinks) { + const base = outboundRE.test(docsRepo) + ? docsRepo + : `https://github.com/${docsRepo}` return ( base.replace(endingSlashRE, '') + `/edit/${docsBranch}/` +