Skip to content

Commit

Permalink
feat: #138 支持Vuepress设置真实预览链接
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Oct 21, 2022
1 parent c84971f commit dbed166
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/components/tab/main/VuepressMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@
<a :href="previewUrl" :title="previewUrl" target="_blank"
v-if="isPublished">{{ $t('main.publish.vuepress.see.preview') }}</a>
</el-form-item>
<el-form-item>
<a :href="previewRealUrl" :title="previewRealUrl" target="_blank"
v-if="isPublished">{{ $t('main.publish.vuepress.see.real.preview') }}</a>
</el-form-item>
</el-form>
</el-aside>
<el-main>
Expand Down Expand Up @@ -267,6 +271,7 @@ const vuepressGithubEnabled = ref(false)
const useDefaultPath = ref(true)
const isPublished = ref(false)
const previewUrl = ref("")
const previewRealUrl = ref("")
const forceRefresh = ref(false)
const tagSwitch = ref(false)
Expand Down Expand Up @@ -400,6 +405,7 @@ async function initPage() {
previewUrl.value = "https://github.com/" + vuepressCfg.githubUser + "/" + vuepressCfg.githubRepo
+ "/blob/" + vuepressCfg.defaultBranch + "/" + docPath
previewRealUrl.value = "https://terwergreen.com" + vuepressData.value.yamlObj.permalink
}
isInitLoadding.value = false
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export default {
"main.publish.vuepress.github.no.tip": "You have not opened github release, please copy the right text on your own",
"main.publish.vuepress.choose.title": "File name",
"main.publish.vuepress.choose.title.tip": "Vuepress-theme-VDoing support file name plus serial number to identify. If you don’t know this usage, please do not modify the file name",
"main.publish.vuepress.see.preview": "Click here see new post",
"main.publish.vuepress.see.preview": "Click here see new md file",
"main.publish.vuepress.see.real.preview": "Click here see new post",
"main.publish.to.wordpress": "Sendto WP",
"main.slug": "Post slug",
"main.auto.fetch.slug": "Auto fetch slug",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export default {
"main.publish.vuepress.choose.title": "文件名",
"main.publish.vuepress.choose.title.tip": "Vuepress-theme-vdoing支持文件名加上序号来标识,如果你不清楚此用法,请不要修改文件名",
"main.publish.vuepress.failure": "发布失败,请自行复制右侧文本",
"main.publish.vuepress.see.preview": "点击这里查看最新文章",
"main.publish.vuepress.see.preview": "点击这里查看MD文件",
"main.publish.vuepress.see.real.preview": "点击这里查看最新文章",
"main.publish.to.wordpress": "发布到Wordpress",
"main.slug": "文章别名",
"main.auto.fetch.slug": "自动生成别名",
Expand Down

0 comments on commit dbed166

Please sign in to comment.