feat(seo): add article date meta tags for blog posts#123
Conversation
✅ Deploy Preview for masterpoint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Review limit reached
More reviews will be available in 49 minutes and 17 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR updates the head template's Open Graph meta tags to emit article-specific metadata for blog pages while retaining website metadata for other sections. ChangesBlog-specific Open Graph Metadata Tags
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
layouts/partials/head.html (1)
13-13: 💤 Low valueConsider using consistent template functions for date formatting.
Line 13 uses
.Date.Format(method syntax) while line 18 usesdateFormat(function syntax). Both work, but using the same approach improves consistency. Note: This pattern already exists in the JSON-LD section (lines 213 vs 215), so it's a broader file-level style choice.♻️ Optional refactor for consistency
{{ if .Params.date_modified }} <meta property="article:modified_time" - content="{{ .Params.date_modified | dateFormat "2006-01-02T15:04:05Z07:00" }}" + content="{{ (.Params.date_modified).Format "2006-01-02T15:04:05Z07:00" }}" /> {{ end }}Alternatively, use
dateFormatfor both (would require updating line 13 as well).Also applies to: 18-18
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@layouts/partials/head.html` at line 13, Standardize date formatting by replacing the method-style call .Date.Format "2006-01-02" with the template function dateFormat used elsewhere (or vice versa if you prefer method-style); update the instances that differ (e.g., the content attribute using .Date.Format and the other occurrences using dateFormat, plus the JSON-LD occurrences where lines use different styles) so all use the same form (preferably dateFormat for consistency) across the file and ensure the same format string "2006-01-02" is preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@layouts/partials/head.html`:
- Line 13: Update the meta tag date format to match the JSON-LD ISO 8601
datetime with timezone: replace the template content="{{ .Date.Format
"2006-01-02" }}" (and the equivalent for modified dates, e.g., .Lastmod.Format)
with the full format string "2006-01-02T15:04:05Z07:00" so
article:published_time and article:modified_time output the same
datetime+timezone that your JSON-LD (lines using "2006-01-02T15:04:05Z07:00")
already uses.
---
Nitpick comments:
In `@layouts/partials/head.html`:
- Line 13: Standardize date formatting by replacing the method-style call
.Date.Format "2006-01-02" with the template function dateFormat used elsewhere
(or vice versa if you prefer method-style); update the instances that differ
(e.g., the content attribute using .Date.Format and the other occurrences using
dateFormat, plus the JSON-LD occurrences where lines use different styles) so
all use the same form (preferably dateFormat for consistency) across the file
and ensure the same format string "2006-01-02" is preserved.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fb9e067a-ca4b-4d1d-8ee8-e9429d9d044a
📒 Files selected for processing (1)
layouts/partials/head.html
e6dc2ba to
a99a62e
Compare
| {{ if eq .Section "blog" }} | ||
| <meta property="og:type" content="article" /> | ||
| <meta | ||
| property="article:published_time" | ||
| content="{{ .Date.Format `2006-01-02T15:04:05Z07:00` }}" | ||
| /> | ||
| {{ if .Params.date_modified }} | ||
| <meta | ||
| property="article:modified_time" | ||
| content="{{ .Params.date_modified | dateFormat `2006-01-02T15:04:05Z07:00` }}" | ||
| /> | ||
| {{ end }} | ||
| {{ else }} | ||
| <meta property="og:type" content="website" /> | ||
| {{ end }} |
There was a problem hiding this comment.
this is the ONLY change. rest is trunk fmt

og:type=article,article:published_time, andarticle:modified_timemeta tags on blog posts, reinforcing the publish/updated dates already in our JSON-LD.For example, this article was updated, so it should update on SEO to show that it's better up to date:

Summary by CodeRabbit