site: improve schema.org json-ld markup #23812
Open
+111
−1
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.
Improves the schema.org json-ld markup to include more metadata.
For example, for this page: https://deploy-preview-23812--docsdocker.netlify.app/build/building/multi-stage/
Our current json-ld metadata is a bit broken:
{ "@context":"https://schema.org", "@type":"WebPage", "headline":"\"Multi-stage\"", "description":"\"Learn about multi-stage builds and how you can use them to improve your builds and get smaller images \"", "url":"https:\/\/docs.docker.com\/build\/building\/multi-stage\/" }With this patch, we get more, well-formatted metadata:
{ "@context": "https://schema.org", "@type": "TechArticle", "articleSection": "manuals", "author": { "@type": "Organization", "name": "Docker Inc", "url": "https://www.docker.com" }, "dateModified": "2024-09-10T15:26:47+02:00", "description": "Learn about multi-stage builds and how you can use them to improve your builds and get smaller images ", "headline": "Multi-stage", "keywords": "build, best, practices", "publisher": { "@type": "Organization", "logo": { "@type": "ImageObject", "url": "https://docs.docker.com/assets/images/docker-logo.png" }, "name": "Docker Inc", "url": "https://www.docker.com" }, "url": "https://docs.docker.com/build/building/multi-stage/" }And we also get the BreadCrumbList (page hierarchy):
{ "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "item": { "@id": "https://docs.docker.com/manuals/", "name": "Manuals" }, "position": 1 }, { "@type": "ListItem", "item": { "@id": "https://docs.docker.com/build/", "name": "Docker Build" }, "position": 2 }, { "@type": "ListItem", "item": { "@id": "https://docs.docker.com/build/building/multi-platform/", "name": "Multi-platform" }, "position": 3 } ] }