DOC-920 | Add structured data markup - #1038
Conversation
|
Deploy Preview Available Via |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughA new Hugo partial generates JSON-LD structured data from page and site metadata, choosing ChangesJSON-LD Structured Data
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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
🤖 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 `@site/themes/arangodb-docs-theme/layouts/partials/structured-data.html`:
- Around line 17-26: The opt-out check for `schema: none` is only applied within
the `.IsPage` branch, preventing the home page (`.IsHome`) from opting out of
schema generation. Move the condition that checks `ne (lower (.Params.schema |
default "")) "none"` to wrap around both the `.IsHome` and `.IsPage` blocks, or
alternatively add this same opt-out check inside the `.IsHome` block before the
schema assignment to ensure both page types respect the `schema: none`
configuration.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9d9d0ef6-80c7-46b0-9575-c48fbdfd9d8f
📒 Files selected for processing (2)
site/themes/arangodb-docs-theme/layouts/partials/head.htmlsite/themes/arangodb-docs-theme/layouts/partials/structured-data.html
| - Home page -> WebSite | ||
| - Docs pages -> TechArticle (Google treats this as Article) | ||
|
|
||
| Opt a single page out with `schema: none` in the front matter. |
| {{- $schema = dict | ||
| "@context" "https://schema.org" | ||
| "@type" "TechArticle" | ||
| "headline" (.Title | markdownify | plainify | htmlUnescape) |
There was a problem hiding this comment.
We might either need the same logic here as used for determining the document title - appending info to the document title (product and product version with #1035) respectively using a separate front matter field if set (most relevant for Ecosystem, still under discussion). FWIW, https://developers.google.com/search/docs/appearance/structured-data/article#article-types doesn't say that it would need to match the actual headline.
Or we need to improve the titles of various documents - e.g. Ecosystem > Integrations > Spring Data > Mapping has pages that merely use "Edge" etc. as H1, lacking context/disambiguation
There was a problem hiding this comment.
I updated it so the headline now adds the site title like the page title does, so "Edge" becomes "Edge :: ArangoDB Documentation", and we can add the product and version later when #1035 is done.
| {{- if not .Lastmod.IsZero -}} | ||
| {{- $schema = merge $schema (dict "dateModified" (.Lastmod.Format "2006-01-02T15:04:05-07:00")) -}} | ||
| {{- end -}} |
There was a problem hiding this comment.
Do the same for WebSite, which also allows it: https://schema.org/WebSite
Then this can be removed because it is redundant: 2c96d12
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Description
Upstream PRs
Summary by CodeRabbit
dateModifiedwhen available, and only renders the structured-data script when enabled.