Skip to content
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

Merged
merged 16 commits into from
Apr 23, 2018
Merged

feat: Add docsRepo #155

merged 16 commits into from
Apr 23, 2018

Conversation

wangyi7099
Copy link
Contributor

@wangyi7099 wangyi7099 commented Apr 19, 2018

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.

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.
@wangyi7099 wangyi7099 changed the title feat: Add docRepo feat: Add docsRepo Apr 19, 2018
Copy link
Member

@ulivz ulivz left a 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.

@wangyi7099
Copy link
Contributor Author

wangyi7099 commented Apr 19, 2018

Didn't see the const definition just now @ulivz

@@ -226,6 +226,8 @@ module.exports = {
themeConfig: {
// Assumes GitHub. Can also be a full GitLab url.
repo: 'vuejs/vuepress',
// Your docs repo address
Copy link
Member

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.

@wangyi7099
Copy link
Contributor Author

Ok, does there something still need to change? @ulivz

if (repo && editLinks) {
const base = outboundRE.test(repo)
? repo
: `https://github.com/${repo}`

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?

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

Copy link
Contributor Author

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.

@@ -57,18 +57,19 @@ export default {
docsDir = '',
docsBranch = 'master'
} = this.$site.themeConfig
Copy link
Contributor

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 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defaults to `themeConfig.repo`

Copy link
Contributor Author

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

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants