From 02cc661be54bf3bf559980c6250b5910c5db32fd Mon Sep 17 00:00:00 2001 From: Rhuan Barreto Date: Mon, 16 Mar 2026 21:15:20 +0100 Subject: [PATCH 1/2] docs(seo): improve Open Graph, structured data, and LLM discoverability Add missing OG meta tags (og:type, og:site_name, og:locale), twitter:card type, hreflang x-default for i18n, and per-page markdown alternate links pointing to raw GitHub source for LLM agents. Enrich SoftwareApplication and TechArticle JSON-LD schemas with version, license, author, and mainEntityOfPage fields. Co-Authored-By: Claude Opus 4.6 (1M context) --- docs/astro.config.mjs | 25 ++++++++++++++++++++++++- docs/src/components/HeadSEO.astro | 29 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 3f580ba0..366afa2b 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -105,7 +105,23 @@ export default defineConfig({ "data-cf-beacon": '{"token": "cee359c05ecc496aabc4f40f05302a03"}', }, }, - // ── Open Graph image ────────────────────────────────────── + // ── Open Graph ──────────────────────────────────────────── + { + tag: "meta", + attrs: { property: "og:type", content: "website" }, + }, + { + tag: "meta", + attrs: { property: "og:site_name", content: "Archgate" }, + }, + { + tag: "meta", + attrs: { property: "og:locale", content: "en_US" }, + }, + { + tag: "meta", + attrs: { property: "og:locale:alternate", content: "pt_BR" }, + }, { tag: "meta", attrs: { @@ -130,6 +146,10 @@ export default defineConfig({ }, }, // ── Twitter / X card ────────────────────────────────────── + { + tag: "meta", + attrs: { name: "twitter:card", content: "summary_large_image" }, + }, { tag: "meta", attrs: { @@ -177,7 +197,10 @@ export default defineConfig({ "@type": "SoftwareApplication", name: "Archgate CLI", applicationCategory: "DeveloperApplication", + applicationSubCategory: "Code Governance", operatingSystem: "macOS, Linux, Windows", + softwareVersion: "0.11.0", + license: "https://github.com/archgate/cli/blob/main/LICENSE", offers: { "@type": "Offer", price: "0", priceCurrency: "USD" }, url: "https://cli.archgate.dev", downloadUrl: "https://www.npmjs.com/package/archgate", diff --git a/docs/src/components/HeadSEO.astro b/docs/src/components/HeadSEO.astro index 0096ebc3..c08419fd 100644 --- a/docs/src/components/HeadSEO.astro +++ b/docs/src/components/HeadSEO.astro @@ -22,6 +22,14 @@ const title = hasRoute ? route.entry.data.title : undefined; const description = hasRoute ? route.entry.data.description : undefined; const template = hasRoute ? route.entry.data.template : undefined; +// ── hreflang alternate links ───────────────────────────────────── +// Map between English and pt-BR pages for search engine language targeting. +const isPtBr = pathname.startsWith("/pt-br/"); +const enPath = isPtBr ? pathname.replace(/^\/pt-br\//, "/") : pathname; +const ptBrPath = isPtBr ? pathname : `/pt-br${pathname}`; +const enUrl = `${siteUrl}${enPath}`; +const ptBrUrl = `${siteUrl}${ptBrPath}`; + // ── BreadcrumbList ──────────────────────────────────────────────── // Build breadcrumbs from the URL path segments. const segments = pathname @@ -64,6 +72,13 @@ const breadcrumbLd = } : null; +// ── Markdown alternate link for LLM agents ────────────────────── +// Points to the raw .mdx source on GitHub so AI crawlers can fetch markdown. +const entryId = hasRoute ? route.entry.id : null; +const markdownUrl = entryId + ? `https://raw.githubusercontent.com/archgate/cli/main/docs/src/content/docs/${entryId}${entryId.endsWith(".mdx") || entryId.endsWith(".md") ? "" : ".mdx"}` + : null; + // ── TechArticle (all doc pages except splash/home) ──────────────── const isSplash = template === "splash"; const articleLd = @@ -74,6 +89,7 @@ const articleLd = headline: title, description, url: pageUrl, + mainEntityOfPage: { "@type": "WebPage", "@id": pageUrl }, inLanguage: route.lang ?? "en", isPartOf: { "@type": "WebSite", @@ -85,12 +101,25 @@ const articleLd = name: "Archgate", url: "https://archgate.dev", }, + author: { + "@type": "Organization", + name: "Archgate", + url: "https://archgate.dev", + }, } : null; --- +{/* hreflang x-default — Starlight already emits en + pt-BR alternates */} + + +{/* Markdown source for LLM agents */} +{markdownUrl && ( + +)} + {/* BreadcrumbList — pages with path segments */} {breadcrumbLd && (