-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add docsRepo #155
feat: Add docsRepo #155
Conversation
In some cases, project and doc are not in the same repo like Vue. So, and a `docRepo` option in config file to distinguish project and doc address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fallback to repo
when docsRepo
is not given, and also need to document it.
Didn't see the const definition just now @ulivz |
docs/default-theme-config/README.md
Outdated
@@ -226,6 +226,8 @@ module.exports = { | |||
themeConfig: { | |||
// Assumes GitHub. Can also be a full GitLab url. | |||
repo: 'vuejs/vuepress', | |||
// Your docs repo address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional, your docs repo address, fallback to repo when it's not given.
Ok, does there something still need to change? @ulivz |
if (repo && editLinks) { | ||
const base = outboundRE.test(repo) | ||
? repo | ||
: `https://github.com/${repo}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it just work for github?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can take a full URL to handle repositories
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it was preserved, I just changed the var name from repo to docsRepo.
lib/default-theme/Page.vue
Outdated
@@ -57,18 +57,19 @@ export default { | |||
docsDir = '', | |||
docsBranch = 'master' | |||
} = this.$site.themeConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add docsRepo = repo
here seems clearer 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
docs/default-theme-config/README.md
Outdated
@@ -226,6 +226,8 @@ module.exports = { | |||
themeConfig: { | |||
// Assumes GitHub. Can also be a full GitLab url. | |||
repo: 'vuejs/vuepress', | |||
// Optional, your docs repo address, fallback to repo when it's not given. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defaults to `themeConfig.repo`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@egoist
Seems the same meaning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is clearer if u specify themeConfig.repo
In some cases, project and doc are not in the same repo like Vue. So, and a
docsRepo
option in config file to distinguish project and doc address.