fix(content-blog): only create archive route if there are blog posts (#6947)

This commit is contained in:
Joshua Chen 2022-03-21 12:27:56 +08:00 committed by GitHub
parent e19a4e23e7
commit 4536c20455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -219,7 +219,7 @@ export default async function pluginContentBlog(
? blogPosts
: blogPosts.slice(0, options.blogSidebarCount);
if (archiveBasePath) {
if (archiveBasePath && blogPosts.length) {
const archiveUrl = normalizeUrl([
baseUrl,
routeBasePath,