CE: JSON-LD structured data for SERP rich results + AI crawlers#316
Merged
CE: JSON-LD structured data for SERP rich results + AI crawlers#316
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add JSON-LD structured data so search engines (Google rich snippets, Knowledge Graph) and AI crawlers (ChatGPT browsing, Perplexity) can properly understand ModelRelay.
crates/modelrelay-web/src/templates.rs—page_shell_customnow renders anOrganizationJSON-LD script on every page it shells (dashboard, legal, integrate, setup, etc).crates/modelrelay-cloud/templates/index.html— landing page (served as static HTML, not via page_shell) gets bothOrganizationandSoftwareApplicationschemas.crates/modelrelay-cloud/templates/pricing.html— pricing page (also static) getsOrganizationschema.Why
Verified gap before this PR: zero
application/ld+jsonblocks on live site (curl -s https://modelrelay.io/ | grep -c ld+jsonreturned 0 for both/and/pricing). JSON-LD enables SERP rich snippets, Knowledge Graph association, and AI crawler metadata extraction.Note on implementation: the landing and pricing pages are served as static HTML strings (
LANDING_HTML/PRICING_HTML), not throughpage_shell. So the Organization schema had to be added directly to those two static templates to hit the live-site validation targets.page_shell-shelled pages (dashboard, legal, setup, integrate, etc.) pick it up automatically through thepage_shell_customchange.Validation
templates::tests::page_shell_includes_organization_jsonldwhich renderspage_shelland asserts the Organization JSON-LD is present.cargo test -p modelrelay-web --lib→ 1 passed.cargo test -p modelrelay-cloud --lib→ 38 passed.cargo fmt --check→ clean.cargo clippy -p modelrelay-web -p modelrelay-cloud --all-targets -- -D warnings→ clean.json.loadsconfirms all rendered JSON-LD blocks parse as valid JSON (noformat!brace-escape bugs).Post-deploy:
curl -s https://modelrelay.io/ | grep -c application/ld+json→ expect 2 (Organization + SoftwareApplication)curl -s https://modelrelay.io/pricing | grep -c application/ld+json→ expect 1 (Organization)