Give docs pages social cards and article structured data - #5625
Open
dimitrieh wants to merge 1 commit into
Open
Conversation
Docs pages carried a title and a description and nothing else: no og:image, no og:url, no article-level structured data. Links to them unfurled bare, while the handbook already had all of it. useSeoMeta now covers the og and twitter tags, keeping the brand suffix that #5593 moved into the global title template (og:title infers from the resolved title, so it stays unset). defineOgImage renders the shared Default card with "Docs" as its section, and useSchemaOrg emits a TechArticle, the schema.org subtype for product documentation, with dateModified read from the git commit stamp docs-sync writes into the synced frontmatter. The derivation moved into nuxt/lib/docs-seo.mjs so node --test can cover it. That also drops an empty tag: pages with no description emitted <meta name="description" content=""> before.
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
Author
|
Preview affected pages:
Every page under |
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
Docs pages had a title and nothing else in their head. This adds what the handbook already has:
useSeoMetaforog:description,og:url,og:typeand the twitter card tags.og:titlestays unset because it infers from the resolved title, brand suffix included.defineOgImage('Default', { section: 'Docs' }), so docs links unfurl with the branded card instead of bare.useSchemaOrg([defineArticle({ '@type': 'TechArticle' })]), withdateModifiedfrom the git commit stampdocs-syncwrites into the synced frontmatter.nuxt/lib/docs-seo.mjswithnode --testcoverage.Titles are unchanged:
titlestays the bare heading and thesiteNametemplate param stays as #5593 left it.Verified on this PR's deploy preview: each docs page serves an
og:imagebuilt from its own title withsection_Docs,og:type=article, an absoluteog:url, the twitter pair, and an ld+json node typed["Article","TechArticle"]withheadlineand a resolveddateModified.og:titlecomes out asBill of Materials • FlowFuse Docsnested andDocumentation • FlowFuseat the root.Correction to an earlier claim in this PR: I first said docs pages emitted
<meta name="description" content="">. They do not, and never did. Production and this preview both serve docs pages with no description meta and noog:descriptionat all, including/docs/whose synced frontmatter has ameta.description. The old code readpage.meta.description, coalesced a miss to an empty string, and unhead dropped the tag. This PR does not fix that and does not claim to. Suspected cause, unconfirmed:metais a built-in@nuxt/contentfield for frontmatter keys a schema does not declare, and the docs schema incontent.config.tsdeclaresmetaas well, so a description written there never reaches the page. If that holds, the fix is in the sync, hoisting it onto the built-in top-leveldescription.Performance: one Satori render per docs page on the first build. The content-addressed
ogImage.buildCachemeans later builds only re-render pages whose title changed.Related Issue(s)
None.
Checklist