Skip to content

Add generic BlogPosting and FAQPage JSON-LD structured data#458

Open
vittorio88 wants to merge 1 commit intodevcows:masterfrom
lagobello:seo/json-ld-blog-faq
Open

Add generic BlogPosting and FAQPage JSON-LD structured data#458
vittorio88 wants to merge 1 commit intodevcows:masterfrom
lagobello:seo/json-ld-blog-faq

Conversation

@vittorio88
Copy link
Contributor

@vittorio88 vittorio88 commented Mar 15, 2026

Summary

  • Adds json-ld-blog.html partial: auto-generates BlogPosting schema for blog posts
  • Adds json-ld-faq.html partial: auto-generates FAQPage schema from front matter
  • Both are included automatically via headers.html — no configuration needed

BlogPosting

Automatically injected on any page where section == "blog". Uses standard Hugo variables (.Title, .Permalink, .Date, .Lastmod, .Description) and falls back to site params for org name and logo.

FAQPage

Driven by front matter. Any page can opt in by adding faq entries:

[[faq]]
question = "How does this work?"
answer = "It generates FAQ rich results in Google."

Test plan

  • Create a blog post and verify BlogPosting JSON-LD appears in page source
  • Create a page with [[faq]] front matter and verify FAQPage JSON-LD appears
  • Validate output with Google Rich Results Test
  • Verify pages without blog/faq have no extra JSON-LD

Auto-inject BlogPosting schema on blog posts and FAQPage schema on any
page with `faq` front-matter entries. Both partials are data-driven from
standard Hugo variables and site params.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant