fix(theme-classic): blog post footer not rendered when only last_update is set#11841
Open
akshatsinha0 wants to merge 1 commit intofacebook:mainfrom
Open
fix(theme-classic): blog post footer not rendered when only last_update is set#11841akshatsinha0 wants to merge 1 commit intofacebook:mainfrom
akshatsinha0 wants to merge 1 commit intofacebook:mainfrom
Conversation
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-flight checklist
Motivation
BlogPostItemFooterreturnsnullon the blog post page when the post has no tags, noeditUrl, but haslast_updateconfigured in front matter. ThelastUpdatedAtandlastUpdatedByvalues are absent from the guard condition, so the function returnsnullbefore they are ever evaluated.The root cause is the outer guard in
BlogPostItem/Footer/index.tsx:truncatedPostis alwaysfalseon the post page (!isBlogPostPage && hasTruncateMarker), so this reduces totagsExists || editUrl.lastUpdatedAtandlastUpdatedByare absent from the condition, so the function returnsnullbefore the innercanDisplayEditMetaRowcheck at line 40 is ever reached.DocItem/Footer/index.tsxdoes not have this problem. Its guard is:This is a feature parity gap between the docs and blog footers.
Fix: align
renderFooterwith the existingcanDisplayEditMetaRowcondition that was already correct:Test Plan
Add a blog post with only
last_updateset (no tags, nocustom_edit_url):After running
yarn workspace website start, to navigate to the post page.Before this fix: the footer section is absent entirely.
After this fix: "Last updated on Jan 1, 2026 by Akshat Sinha" renders correctly.
Test links
Deploy preview: https://deploy-preview-11841--docusaurus-2.netlify.app/
Related issues/PRs
No related issues found.