Skip to content

Conversation

@pyrytakala
Copy link

@pyrytakala pyrytakala commented Nov 18, 2025

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.

  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.

  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Fixes a bug where author pages were displaying unlisted blog posts. Author pages should only show listed posts, consistent with tag pages, archive pages, and the main blog list.

Root Cause: The createAuthorPaginatedRoute function was using unfiltered authorBlogPosts instead of filtering out unlisted posts before pagination. Unlike tag pages, archive pages, and the main blog list (which all use listedBlogPosts), author pages were missing the filtering step.

Note: The isUnlisted() function only returns true in production mode (or with SIMULATE_PRODUCTION_VISIBILITY=true). In development mode, unlisted posts appear as listed, but this is expected behavior - the fix works correctly in production builds.

Test Plan

Manual Testing

  1. Created test blog posts (listed and unlisted) assigned to an author
  2. Verified unlisted post does NOT appear on author page (/blog/authors/slorber)
  3. Verified listed posts DO appear on author page
  4. Verified direct link to unlisted post still works
  5. Verified author list page shows correct counts (excluding unlisted)

Consistency Check

  • Tag pages filter unlisted posts - packages/docusaurus-plugin-content-blog/src/blogUtils.ts:141-152 via getTagVisibility()
  • Archive page filters unlisted posts - uses listedBlogPosts at packages/docusaurus-plugin-content-blog/src/routes.ts:92,163
  • Main blog list filters unlisted posts - uses listedBlogPosts at packages/docusaurus-plugin-content-blog/src/index.ts:259,295
  • Author pages now filter unlisted posts - uses listedAuthorBlogPosts.filter(shouldBeListed) at packages/docusaurus-plugin-content-blog/src/routes.ts:321,306

Testing with Production Flag

Tested with SIMULATE_PRODUCTION_VISIBILITY=true to verify unlisted posts are correctly filtered in production mode.

Commands Run

SIMULATE_PRODUCTION_VISIBILITY=true yarn workspace website start --port 3002
yarn workspace @docusaurus/plugin-content-blog build

Test links

Deploy preview:
https://deploy-preview-11559--docusaurus-2.netlify.app/

Related issues/PRs

None - this is a bug fix identified during code review. The bug report analysis showed that author pages were the only blog route type not filtering unlisted posts, while tag pages, archive pages, and the main blog list all correctly filter them.

@meta-cla
Copy link

meta-cla bot commented Nov 18, 2025

Hi @pyrytakala!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@netlify
Copy link

netlify bot commented Nov 18, 2025

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 068cf2b
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/691d036f4e8ebb0008bf6f8f
😎 Deploy Preview https://deploy-preview-11559--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@meta-cla
Copy link

meta-cla bot commented Nov 18, 2025

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla bot added the CLA Signed Signed Facebook CLA label Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant