hugo-universal-theme icon indicating copy to clipboard operation
hugo-universal-theme copied to clipboard

Add generic BlogPosting and FAQPage JSON-LD structured data

Open vittorio88 opened this issue 8 months ago • 0 comments

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

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

vittorio88 avatar Mar 15 '26 05:03 vittorio88