-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Changes from 10 commits
9b79f55
3dd4783
cdf5094
dcb8d8e
322d2db
e549f1a
aa6e1ba
f60ba68
71e2ce8
c6b0814
d3dac3b
8337700
5929743
572301b
c2fa975
01c4bff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks |
||
|
||
|
||
const docsRepo = this.$site.themeConfig.docsRepo || repo | ||
let path = normalize(this.$page.path) | ||
if (endingSlashRE.test(path)) { | ||
path += 'README.md' | ||
} else { | ||
path += '.md' | ||
} | ||
|
||
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 commentThe 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 commentThe 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 commentThe 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. |
||
if (docsRepo && editLinks) { | ||
const base = outboundRE.test(docsRepo) | ||
? docsRepo | ||
: `https://github.com/${docsRepo}` | ||
return ( | ||
base.replace(endingSlashRE, '') + | ||
`/edit/${docsBranch}/` + | ||
|
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