hugo-universal-theme
hugo-universal-theme copied to clipboard
Add generic BlogPosting and FAQPage JSON-LD structured data
Summary
- Adds
json-ld-blog.htmlpartial: auto-generates BlogPosting schema for blog posts - Adds
json-ld-faq.htmlpartial: 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