Skip to content

Show blog post publish date in search results#20077

Open
cnunciato wants to merge 4 commits into
masterfrom
cnunciato/blog-search-publish-date
Open

Show blog post publish date in search results#20077
cnunciato wants to merge 4 commits into
masterfrom
cnunciato/blog-search-publish-date

Conversation

@cnunciato

@cnunciato cnunciato commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What

Adds the blog post publish date to blog results in the search dialog, as requested by folks searching the blog who wanted a date on each result.

Fixes #13801.

Flying a little bit blind here until the date field gets added to Algolia (which'll happen on release), but this should look like this once deployed:

image

How

Threads the date through all four layers of the search pipeline, scoped to blog hits only (docs/registry/etc. records are unchanged):

  • layouts/index.json — Hugo's search-index JSON now emits a formatted date (Jan 2, 2006, matching the blog UI) for blog pages that have a non-zero date.
  • scripts/search/page.js — carries date onto each Algolia record (undefined for non-blog records, keeping them clean).
  • theme/src/ts/algolia/autocomplete.ts — renders the date under the description when a hit has one.
  • theme/src/scss/_algolia.scss — styles it as small muted text. Uses literal Tailwind gray classes that the docs dark-mode block auto-remaps, so it reads correctly in both themes.

Notes

  • The dates appear in the live dialog only after the Algolia index is regenerated, which happens in the normal build/deploy pipeline (Hugo produces public/index.json, then records are re-uploaded). Existing records won't have the field until then.
  • date is a display-only attribute — deliberately not added to searchable attributes.
  • Verified the theme webpack build compiles cleanly.

🤖 Generated with Claude Code

Adds the publish date to blog results in the search dialog. Threads the
date through all four layers of the search pipeline, scoped to blog hits:

- layouts/index.json: emit a formatted date for blog pages
- scripts/search/page.js: carry date onto the Algolia record
- autocomplete.ts: render the date under the description for dated hits
- _algolia.scss: style it as small muted text (dark-mode safe)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pulumi-bot

pulumi-bot commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

@pulumi-bot

pulumi-bot commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Lighthouse Performance Report

Commit: cc9f9d5 | Metric definitions

Page Device Score FCP LCP TBT CLS SI
Homepage Mobile 🔴 35 3.2s 6.5s 2447ms 0.012 7.9s
Homepage Desktop 🟡 81 0.8s 1.1s 334ms 0.019 1.6s
Install Pulumi Mobile 🟡 55 5.5s 8.6s 184ms 0.057 8.2s
Install Pulumi Desktop 🟡 81 1.3s 1.9s 0ms 0.010 3.0s
AWS Get Started Mobile 🟡 54 5.4s 8.6s 144ms 0.092 7.9s
AWS Get Started Desktop 🟡 88 1.3s 1.7s 0ms 0.036 1.7s

Moves the search-result publish date directly beneath the title (above the
description), shrinks it slightly (11px), and pulls it snug to the title with
a negative top margin so it reads as part of the title rather than the summary.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cnunciato cnunciato marked this pull request as ready for review July 2, 2026 23:35
@github-actions github-actions Bot added the review:triaging Claude Triage is currently classifying the PR label Jul 2, 2026
@cnunciato cnunciato requested a review from jeffmerrick July 2, 2026 23:36
@github-actions github-actions Bot added domain:infra PR touches workflows, scripts, infra, Makefile, or build config review:in-progress Claude review is currently running and removed review:triaging Claude Triage is currently classifying the PR labels Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Pre-merge Review — Last updated 2026-07-02T23:37:35Z

Tip

Summary: This is an infrastructure change (Hugo template + JS + SCSS + TypeScript) that surfaces a blog post's publish date on its Algolia search-result card. The four edits form one consistent chain: layouts/index.json computes a date string (formatted Jan 2, 2006) only for pages in the blog section with a non-zero date and adds it to the search index; scripts/search/page.js maps that field onto each hit (item.date || undefined); theme/src/ts/algolia/autocomplete.ts adds the optional date field to the hit interface and renders a .date element only when present; and theme/src/scss/_algolia.scss styles it. The wrongness that would matter here — dates leaking onto non-blog results, a mis-formatted date, or the render breaking when a date is absent — is guarded by the blog-section check, the IsZero guard, and the conditional render, so the guards line up end to end. Review passes: infra code review and a Hugo/link-integrity preflight (no findings). No factual claims were present to verify, and the change is not under content/blog/, so no editorial-balance pass applied.

Review confidence:

Dimension Level Notes
mechanics HIGH
facts HIGH No factual claims in this diff.
Investigation log
  • Cross-sibling reads: not run (not in a templated section)
  • External claim verification: not run (no claims in this diff)
  • Cited-claim spot-checks: not run (no cited claims)
  • Frontmatter sweep: not run (no frontmatter in diff)
  • Temporal-trigger sweep: not run (no trigger words)
  • Code execution: not run (no static/programs/ change)
  • Code-examples checks: not run (no fenced code blocks in content files)
  • Editorial-balance pass: not run (not under content/blog/)
🚨 Outstanding ⚠️ Low-confidence 💡 Pre-existing ✅ Resolved
0 0 0 0

🔍 Verification trail

No verifiable claims extracted from this diff.

🚨 Outstanding in this PR

No outstanding findings in this PR.

⚠️ Low-confidence

No low-confidence findings.

💡 Pre-existing issues in touched files (optional)

No pre-existing issues in touched files.

✅ Resolved since last review

No items resolved since the last review.

📜 Review history

  • 2026-07-02T23:37:35Z — Reviewed the four-file change that shows blog publish dates in search results; guards and render chain are consistent, no blockers. (17cfcd6)

Need a re-review? Want to dispute a finding? Mention @claude and include #update-review.
(For ad-hoc questions or fixes, just @claude — no hashtag.)

@github-actions github-actions Bot added review:no-blockers Claude review completed cleanly; outstanding is empty and removed review:in-progress Claude review is currently running labels Jul 2, 2026
@cnunciato cnunciato requested a review from CamSoper July 2, 2026 23:48
@github-actions github-actions Bot added review:stale New commits since last Claude review; refresh on next ready-transition or @claude mention and removed review:no-blockers Claude review completed cleanly; outstanding is empty labels Jul 2, 2026
@cnunciato cnunciato requested a review from tatcoo-pulumi July 2, 2026 23:50
@cnunciato cnunciato enabled auto-merge (squash) July 3, 2026 14:37
@cnunciato cnunciato requested a review from jkodroff July 3, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain:infra PR touches workflows, scripts, infra, Makefile, or build config review:stale New commits since last Claude review; refresh on next ready-transition or @claude mention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show the publish date in the preview for blog search results

2 participants