Skip to content

Commit

Permalink
fix: rss plugins are not loaded when not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
hacxy committed Jan 10, 2025
1 parent 32e042f commit b78c996
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default defineConfigWithTheme<ThemeConfig>({
},
rss: {
title: 'Hacxy',
baseUrl: 'http://localhost:4173',
baseUrl: 'https"//theme.hacxy.cn',
copyright: 'Copyright (c) 2024-present, Hacxy'
},
logo: '/logo.png',
Expand Down
4 changes: 3 additions & 1 deletion packages/theme/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
};
}
Expand Down

0 comments on commit b78c996

Please sign in to comment.