From 75acdb1b93e9c753a52804129cd23716bea7e649 Mon Sep 17 00:00:00 2001 From: Derek <256792747+decofe@users.noreply.github.com> Date: Fri, 26 Jun 2026 05:06:22 +0000 Subject: [PATCH 1/5] Add docs SEO and AEO metadata --- src/components/DocsJsonLd.tsx | 67 ++++++++++++++++++++ src/pages/docs/_layout.tsx | 2 + src/pages/docs/guide/using-tempo-with-ai.mdx | 2 + src/pages/docs/tools.mdx | 2 + 4 files changed, 73 insertions(+) create mode 100644 src/components/DocsJsonLd.tsx diff --git a/src/components/DocsJsonLd.tsx b/src/components/DocsJsonLd.tsx new file mode 100644 index 00000000..73df5245 --- /dev/null +++ b/src/components/DocsJsonLd.tsx @@ -0,0 +1,67 @@ +const tempoSameAs = [ + 'https://x.com/tempo', + 'https://twitter.com/tempo', + 'https://github.com/tempoxyz', + 'https://www.linkedin.com/company/tempoxyz', + 'https://www.crunchbase.com/organization/tempo-87e4', +] + +const tempoKnowsAbout = [ + 'stablecoin payments', + 'cross-border payments', + 'global payouts', + 'agentic payments', + 'machine payments', + 'enterprise settlement', + 'payment blockchains', + 'Layer 1 blockchain', + 'stablecoin infrastructure', +] + +const description = + 'Tempo is a payments-first Layer 1 blockchain incubated by Stripe and Paradigm. Tempo documentation covers stablecoin payments, global payouts, agentic payments, APIs, wallets, and protocol specifications.' + +export default function DocsJsonLd(props: { path: string }) { + const pathname = props.path.startsWith('/') ? props.path : `/${props.path}` + const url = `https://docs.tempo.xyz${pathname}` + const schema = { + '@context': 'https://schema.org', + '@graph': [ + { + '@type': 'Organization', + '@id': 'https://tempo.xyz/#organization', + name: 'Tempo', + url: 'https://tempo.xyz', + description, + sameAs: tempoSameAs, + knowsAbout: tempoKnowsAbout, + }, + { + '@type': 'WebSite', + '@id': 'https://docs.tempo.xyz/#website', + name: 'Tempo Docs', + url: 'https://docs.tempo.xyz', + description, + publisher: { '@id': 'https://tempo.xyz/#organization' }, + }, + { + '@type': 'TechArticle', + '@id': url, + url, + headline: 'Tempo documentation', + description, + isPartOf: { '@id': 'https://docs.tempo.xyz/#website' }, + about: { '@id': 'https://tempo.xyz/#organization' }, + publisher: { '@id': 'https://tempo.xyz/#organization' }, + }, + ], + } + + return ( + ', + }), + ) + + expect(json).not.toContain('') + expect(json).toContain('\\u003c/script\\u003e') + expect(json).toContain('\\u003e') + }) +}) diff --git a/src/components/DocsJsonLd.tsx b/src/components/DocsJsonLd.tsx new file mode 100644 index 00000000..c5d1229f --- /dev/null +++ b/src/components/DocsJsonLd.tsx @@ -0,0 +1,89 @@ +import { useRouter } from 'vocs' + +const tempoSameAs = [ + 'https://x.com/tempo', + 'https://twitter.com/tempo', + 'https://github.com/tempoxyz', + 'https://www.linkedin.com/company/tempoxyz', + 'https://www.crunchbase.com/organization/tempo-87e4', +] + +const tempoKnowsAbout = [ + 'stablecoin payments', + 'cross-border payments', + 'global payouts', + 'agentic payments', + 'machine payments', + 'enterprise settlement', + 'payment blockchains', + 'Layer 1 blockchain', + 'stablecoin infrastructure', +] + +const description = + 'Tempo is a payments-first Layer 1 blockchain incubated by Stripe and Paradigm. Tempo documentation covers stablecoin payments, global payouts, agentic payments, APIs, wallets, and protocol specifications.' + +type DocsJsonLdOptions = { + path?: string +} + +export function createDocsJsonLdSchema(options: DocsJsonLdOptions = {}) { + const path = options.path || '/docs' + const pathname = path.startsWith('/') ? path : `/${path}` + const url = `https://docs.tempo.xyz${pathname}` + + return { + '@context': 'https://schema.org', + '@graph': [ + { + '@type': 'Organization', + '@id': 'https://tempo.xyz/#organization', + name: 'Tempo', + url: 'https://tempo.xyz', + description, + sameAs: tempoSameAs, + knowsAbout: tempoKnowsAbout, + }, + { + '@type': 'WebSite', + '@id': 'https://docs.tempo.xyz/#website', + name: 'Tempo Docs', + url: 'https://docs.tempo.xyz', + description, + publisher: { '@id': 'https://tempo.xyz/#organization' }, + }, + { + '@type': 'TechArticle', + '@id': url, + url, + headline: 'Tempo documentation', + description, + isPartOf: { '@id': 'https://docs.tempo.xyz/#website' }, + about: { '@id': 'https://tempo.xyz/#organization' }, + publisher: { '@id': 'https://tempo.xyz/#organization' }, + }, + ], + } +} + +export function serializeJsonLd(schema: unknown) { + return JSON.stringify(schema) + .replace(//g, '\\u003e') + .replace(/&/g, '\\u0026') +} + +export default function DocsJsonLd(props: { path?: string }) { + const { path } = useRouter() + const schema = createDocsJsonLdSchema({ + path: props.path ?? path, + }) + + return ( +