Repository navigation
Add TechArticle JSON-LD to tech docs pages - #445
Merged
Merged
Conversation
jacobgkau
approved these changes
Nov 9, 2026
jacobgkau
left a comment
Member
There was a problem hiding this comment.
Seems very silly that a tool could already tell this was an article, we already provided all of the data it's asking for, but we need to copy the data from one set of tags into another to increase an audit score. But I don't see any problems with what's being added.
I still think canonical URLs without the trailing slash would've been better for articles, but again, we already list <link rel="canonical" href="... with the trailing slash, and what's being added here matches that.
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.
Description:
Site Audit flags tech-docs pages under "Article page missing Article schema". This adds schema.org
TechArticlestructured data to the docs pages through a Starlight route middleware.What changed
src/plugins/techarticle-json-ld-middleware.ts, registered inastro.config.ts(routeMiddlewareis now an array: the existing ToC middleware plus this one).
<script type="application/ld+json">intostarlightRoute.head. No component overrides.headline(page title),description(only if the frontmatter has one),urlandmainEntityOfPage(reuses Starlight's canonical link, so the/tech-docsbase and host are right perenvironment),
dateModified(git last-updated, omitted if unavailable),inLanguage,author,publisher.404, the landing page and/archive/, which aren't articles.<is escaped as\u003cso page text can't close the script tag.