From b78c996119b8ce78796fb72d1265c896bde5fc6e Mon Sep 17 00:00:00 2001 From: hacxy Date: Fri, 10 Jan 2025 12:12:46 +0800 Subject: [PATCH] fix: rss plugins are not loaded when not defined --- packages/docs/.vitepress/config.ts | 2 +- packages/theme/node.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/docs/.vitepress/config.ts b/packages/docs/.vitepress/config.ts index 094422d..012f4b9 100644 --- a/packages/docs/.vitepress/config.ts +++ b/packages/docs/.vitepress/config.ts @@ -24,7 +24,7 @@ export default defineConfigWithTheme({ }, rss: { title: 'Hacxy', - baseUrl: 'http://localhost:4173', + baseUrl: 'https"//theme.hacxy.cn', copyright: 'Copyright (c) 2024-present, Hacxy' }, logo: '/logo.png', diff --git a/packages/theme/node.ts b/packages/theme/node.ts index 5d8d533..d4baad6 100644 --- a/packages/theme/node.ts +++ b/packages/theme/node.ts @@ -18,7 +18,9 @@ function rss(): Plugin { resolveConfig = config; // 拿到用户的主题配置, 手动调用hook const VPConfig: SiteConfig = config.vitepress; - return RssPlugin(VPConfig.site.themeConfig.rss).configResolved(config); + if (VPConfig.site?.themeConfig?.rss) { + return RssPlugin(VPConfig.site.themeConfig.rss).configResolved(config); + } } }; }