-
Notifications
You must be signed in to change notification settings - Fork 25.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix jsonify name in seo.html application/ld+json script #1485
Conversation
Thanks for the PR. Question, would the |
To reproduce, set the "name:" field to a string "This is a "Test"" and validate the result via https://search.google.com/structured-data/testing-tool Without this fix seo.html produces something like:
|
jsonify is the better option. |
@d00616 You have to remove the quotes around the variable. To keep things consistent I'd prefer to use This would be the change: <script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "{% if site.social.type %}{{ site.social.type }}{% else %}Person{% endif %}",
"name": {{ site.social.name | default: site.name | jsonify }},
"url": {{ seo_url | jsonify }},
"sameAs": {{ site.social.links | jsonify }}
}
</script> Which produces this valid JSON: <script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Person",
"name": "This is a \"Test\"",
"url": null,
"sameAs": null
}
</script> |
It's changed. |
Thank you. |
* upstream/master: (528 commits) Fix docs. Change Isaac Newton with Albert Einstein (mmistakes#1508) Replace `|` with HTML entity when used as title separator Update stale.yml Remove ignore file Fix border bottom for Gist line numbers Update CHANGELOG and history fix a typo in 04-upgrading.md (mmistakes#1487) Update CHANGELOG and history Remove extra spaces after : Fix jsonify name in seo.html application/ld+json script (mmistakes#1485) Update CHANGELOG and history Add archive feature row test page Add archive feature row test page Adjust feature row styling when used on an `archive` layout Remove misleading underline hover state Replace toc include with `toc: true` Remove base_path include from pages Reduce font-size of page meta in list/grid items Underline archive item titles Update issue template ...
When the name includes " then the resulting schema is invalid. This is a fix.