@@ -294,12 +294,14 @@ export async function buildAllRoutes({
294294 sidebar : sidebarModulePath ,
295295 } ,
296296 props : {
297- authors : authors . map ( ( author ) =>
298- toAuthorItemProp ( {
297+ authors : authors . map ( ( author ) => {
298+ const authorPosts = blogPostsByAuthorKey [ author . key ] ?? [ ] ;
299+ const listedAuthorPosts = authorPosts . filter ( shouldBeListed ) ;
300+ return toAuthorItemProp ( {
299301 author,
300- count : blogPostsByAuthorKey [ author . key ] ?. length ?? 0 ,
301- } ) ,
302- ) ,
302+ count : listedAuthorPosts . length ,
303+ } ) ;
304+ } ) ,
303305 } ,
304306 context : {
305307 blogMetadata : blogMetadataModulePath ,
@@ -309,12 +311,13 @@ export async function buildAllRoutes({
309311
310312 function createAuthorPaginatedRoute ( author : AuthorWithKey ) : RouteConfig [ ] {
311313 const authorBlogPosts = blogPostsByAuthorKey [ author . key ] ?? [ ] ;
314+ const listedAuthorBlogPosts = authorBlogPosts . filter ( shouldBeListed ) ;
312315 if ( ! author . page ) {
313316 return [ ] ;
314317 }
315318
316319 const pages = paginateBlogPosts ( {
317- blogPosts : authorBlogPosts ,
320+ blogPosts : listedAuthorBlogPosts ,
318321 basePageUrl : author . page . permalink ,
319322 blogDescription,
320323 blogTitle,
@@ -332,7 +335,10 @@ export async function buildAllRoutes({
332335 sidebar : sidebarModulePath ,
333336 } ,
334337 props : {
335- author : toAuthorItemProp ( { author, count : authorBlogPosts . length } ) ,
338+ author : toAuthorItemProp ( {
339+ author,
340+ count : listedAuthorBlogPosts . length ,
341+ } ) ,
336342 listMetadata : metadata ,
337343 } ,
338344 context : {
0 commit comments