Skip to content

Commit

Permalink
feat(pageeditlink): modify page editLink rule
Browse files Browse the repository at this point in the history
if use github actions,the page of editLink will be change
  • Loading branch information
xcyeye committed Oct 15, 2021
1 parent 1dcaed8 commit 64a71cd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @vuepress-theme-aurora
# [1.0.0](https://github.com/qsyyke/vuepress-theme-aurora/compare/v1.3.3...v1.0.0) (2021-10-14)



Expand Down
20 changes: 18 additions & 2 deletions docs/.vuepress/theme/lib/client/components/PageMeta.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<footer class="page-meta">
<div v-if="editNavLink" class="meta-item edit-link">
<div v-if="editNavLink" :data="editNavLink" class="meta-item edit-link">
<NavLink class="meta-item-label" :item="editNavLink" />
</div>

Expand Down Expand Up @@ -134,9 +134,25 @@ export default defineComponent({
setup() {
const themeLocale = useThemeLocaleData()
const editNavLink = useEditNavLink()
let editNavLink = useEditNavLink()
const lastUpdated = useLastUpdated()
const contributors = useContributors()
const page = usePageData()
let githubActions = themeLocale.value.githubActions
if (githubActions && themeLocale.value.docsRepo !== undefined) {
let filePathRelative = page.value.filePathRelative
let docsRepo = themeLocale.value.docsRepo
let docsBranch = ''
if (themeLocale.value.docsBranch !== undefined) {
docsBranch = themeLocale.value.docsBranch
}else {
docsBranch = 'main'
}
editNavLink.value.link = docsRepo + "/edit/" + docsBranch + "/docs/" + filePathRelative
}
return {
themeLocale,
Expand Down
3 changes: 2 additions & 1 deletion docs/.vuepress/themeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports = {
darkMode: false,
repo: "https://github.com/qsyyke/vuepress-theme-aurora",
docsRepo: 'https://github.com/qsyyke/aurora-docs',
docsBranch: 'master',
githubActions: true,
docsBranch: 'main',
repoLabel: "Aurora-theme",
editLink: true,
editLinkText: "edit",
Expand Down

0 comments on commit 64a71cd

Please sign in to comment.