Skip to content

DOC-920 | Add structured data markup - #1038

Open
nicos-arango wants to merge 5 commits into
mainfrom
DOC-920
Open

DOC-920 | Add structured data markup#1038
nicos-arango wants to merge 5 commits into
mainfrom
DOC-920

Conversation

@nicos-arango

@nicos-arango nicos-arango commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

Upstream PRs

  • 3.10:
  • 3.11:
  • 3.12:
  • 4.0:

Summary by CodeRabbit

  • New Features
    • Added JSON-LD structured data generation (rich snippets) to the documentation theme.
    • Automatically outputs schema for the homepage (WebSite) and content pages (TechArticle), including organization publisher details and author/publisher attribution.
    • Uses page description with a site fallback, sets language with an English default, conditionally includes dateModified when available, and only renders the structured-data script when enabled.

@arangodb-docs-automation

Copy link
Copy Markdown
Contributor

Deploy Preview Available Via
https://deploy-preview-1038--docs-hugo.netlify.app

@cla-bot cla-bot Bot added the cla-signed label Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eba6a2ad-d524-4634-a0f1-fc10dfe0e104

📥 Commits

Reviewing files that changed from the base of the PR and between b1fa717 and a0b4a23.

📒 Files selected for processing (1)
  • site/themes/arangodb-docs-theme/layouts/partials/structured-data.html
🚧 Files skipped from review as they are similar to previous changes (1)
  • site/themes/arangodb-docs-theme/layouts/partials/structured-data.html

📝 Walkthrough

Walkthrough

A new Hugo partial generates JSON-LD structured data from page and site metadata, choosing WebSite or TechArticle output by page type. The theme head template now includes this partial.

Changes

JSON-LD Structured Data

Layer / File(s) Summary
Structured data partial and head wiring
site/themes/arangodb-docs-theme/layouts/partials/structured-data.html, site/themes/arangodb-docs-theme/layouts/partials/head.html
Adds a structured-data.html partial that emits JSON-LD with shared publisher metadata, page URL/title/description fields, language fallback, and optional dateModified, then includes it in <head>.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding structured data markup to the docs theme.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch DOC-920

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between dd4229d and e968f0a.

📒 Files selected for processing (2)
  • site/themes/arangodb-docs-theme/layouts/partials/head.html
  • site/themes/arangodb-docs-theme/layouts/partials/structured-data.html

Comment thread site/themes/arangodb-docs-theme/layouts/partials/structured-data.html Outdated
Comment thread site/themes/arangodb-docs-theme/layouts/partials/structured-data.html Outdated
Comment thread site/themes/arangodb-docs-theme/layouts/partials/structured-data.html Outdated
- Home page -> WebSite
- Docs pages -> TechArticle (Google treats this as Article)

Opt a single page out with `schema: none` in the front matter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that useful?

Comment thread site/themes/arangodb-docs-theme/layouts/partials/structured-data.html Outdated
{{- $schema = dict
"@context" "https://schema.org"
"@type" "TechArticle"
"headline" (.Title | markdownify | plainify | htmlUnescape)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread site/themes/arangodb-docs-theme/layouts/partials/structured-data.html Outdated
Comment thread site/themes/arangodb-docs-theme/layouts/partials/structured-data.html Outdated
Comment on lines +35 to +37
{{- if not .Lastmod.IsZero -}}
{{- $schema = merge $schema (dict "dateModified" (.Lastmod.Format "2006-01-02T15:04:05-07:00")) -}}
{{- end -}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the same for WebSite, which also allows it: https://schema.org/WebSite

Then this can be removed because it is redundant: 2c96d12

@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants