From 07e51a7013abea452548da1c34f4cdcb634e7e28 Mon Sep 17 00:00:00 2001 From: terwer Date: Wed, 14 Dec 2022 01:40:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20#133=20=E6=94=AF=E6=8C=81Github=E7=B3=BB?= =?UTF-8?q?=E5=88=97-=E4=BF=AE=E5=A4=8DJekyll=E5=B9=B3=E5=8F=B0=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/publish/PublishService.vue | 30 +++-------------------- components/publish/tab/ServiceSwitch.vue | 2 -- composables/publish/initPublishCom.ts | 7 +++++- utils/platform/github/jekyll/jekyllCfg.ts | 1 + 4 files changed, 11 insertions(+), 29 deletions(-) diff --git a/components/publish/PublishService.vue b/components/publish/PublishService.vue index 7866c23c..463ab3d6 100644 --- a/components/publish/PublishService.vue +++ b/components/publish/PublishService.vue @@ -43,19 +43,19 @@ - + - + - + @@ -75,10 +75,6 @@ const logger = LogFactory.getLogger("components/publish/PublishService.vue") const defaultTab = ref("platform-main") const isReloadServiceTab = ref(false) -const isReloadSettingTab = ref(false) -const isReloadPostBindTab = ref(false) -const isReloadServiceSwitchTab = ref(false) -const isReloadCommonSettingTab = ref(false) const props = defineProps({ isReload: { @@ -94,25 +90,7 @@ const props = defineProps({ const serviceTabChange = (name) => { const paneName = name.paneName logger.debug("serviceTabChange=>", paneName) - if (paneName === "platform-main") { - isReloadServiceTab.value = !isReloadServiceTab.value - } - - if (paneName === "platform-setting") { - isReloadSettingTab.value = !isReloadSettingTab.value - } - - if (paneName === "post-bind") { - isReloadPostBindTab.value = !isReloadPostBindTab.value - } - - if (paneName === "service-switch") { - isReloadServiceSwitchTab.value = !isReloadServiceSwitchTab.value - } - - if (paneName === "general-setting") { - isReloadCommonSettingTab.value = !isReloadCommonSettingTab.value - } + isReloadServiceTab.value = !isReloadServiceTab.value } diff --git a/components/publish/tab/ServiceSwitch.vue b/components/publish/tab/ServiceSwitch.vue index 3dc5172a..30519f4f 100644 --- a/components/publish/tab/ServiceSwitch.vue +++ b/components/publish/tab/ServiceSwitch.vue @@ -111,8 +111,6 @@ import { } from "~/utils/platform/dynamicConfig" import { LogFactory } from "~/utils/logUtil" -const logger = LogFactory.getLogger("components/publish/tab/ServiceSwitch.vue") - // use const { tabCountStore, diff --git a/composables/publish/initPublishCom.ts b/composables/publish/initPublishCom.ts index 11bc313a..c7f6926a 100644 --- a/composables/publish/initPublishCom.ts +++ b/composables/publish/initPublishCom.ts @@ -410,7 +410,12 @@ export const useInitPublish = (props, deps, otherArgs?) => { const docPath = githubPagesMethods.getGithubPagesData().publishPath const categories = initPublishMethods.convertDocPathToCategories(docPath) - url = url.replace(/\[cats]/, categories.join("/")) + // 处理分类 + if (categories.length > 0) { + url = url.replace(/\[cats]/, categories.join("/")) + } else { + url = url.replace(/\/\[cats]/, "") + } } initPublishData.previewUrl = pathJoin(home, url) } diff --git a/utils/platform/github/jekyll/jekyllCfg.ts b/utils/platform/github/jekyll/jekyllCfg.ts index fb28bbc6..3286e0bf 100644 --- a/utils/platform/github/jekyll/jekyllCfg.ts +++ b/utils/platform/github/jekyll/jekyllCfg.ts @@ -36,6 +36,7 @@ export class JekyllCfg extends GithubCfg { this.defaultPath = "_posts" this.posidKey = POSTID_KEY_CONSTANTS.JEKYLL_POSTID_KEY + this.previewMdUrl = "/[user]/[repo]/blob/[branch]/[docpath]" this.previewUrl = "/[cats]/[yyyy]/[mm]/[dd]/[postid].html" this.mdFilenameRule = "[yyyy]-[mm]-[dd]-[slug].md" }