mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-20 04:27:04 +02:00
refactor(v2): do not generate RSS files for empty feed (#4905)
This commit is contained in:
parent
526ce44933
commit
f71e83450f
4 changed files with 10 additions and 29 deletions
|
@ -117,6 +117,7 @@ export default function pluginContentBlog(
|
|||
const {postsPerPage, routeBasePath} = options;
|
||||
|
||||
blogPosts = await generateBlogPosts(contentPaths, context, options);
|
||||
|
||||
if (!blogPosts.length) {
|
||||
return null;
|
||||
}
|
||||
|
@ -506,9 +507,14 @@ export default function pluginContentBlog(
|
|||
},
|
||||
|
||||
injectHtmlTags() {
|
||||
if (!blogPosts.length) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (!options.feedOptions?.type) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const feedTypes = options.feedOptions.type;
|
||||
const {
|
||||
siteConfig: {title},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue