diff --git a/astro.config.mjs b/astro.config.mjs index 0f31898f..0d47e8ea 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -9,6 +9,7 @@ import remarkHeadingId from "./plugins/remark-heading-id.mjs"; import remarkPlantUML from "./plugins/remark-plantuml.mjs"; import agentDocs from "./plugins/astro-agent-docs.mjs"; import { sidebar } from "./sidebar.mjs"; +import { TITLE, DESCRIPTION, PUBLISHER, OG_ALT } from "./src/branding.mjs"; // https://astro.build/config export default defineConfig({ @@ -21,7 +22,7 @@ export default defineConfig({ }, integrations: [ starlight({ - title: "ICP Developer Docs", + title: TITLE, components: { EditLink: "./src/components/EditLink.astro", Footer: "./src/components/Footer.astro", @@ -42,7 +43,7 @@ export default defineConfig({ attrs: { rel: "alternate", type: "application/rss+xml", - title: "ICP Developer Docs", + title: TITLE, href: "/feed.xml", }, }, @@ -52,7 +53,7 @@ export default defineConfig({ }, { tag: "meta", - attrs: { name: "author", content: "DFINITY Foundation" }, + attrs: { name: "author", content: PUBLISHER }, }, { tag: "meta", @@ -60,7 +61,7 @@ export default defineConfig({ }, { tag: "meta", - attrs: { property: "og:image:alt", content: "ICP Developer Docs — Build on Internet Computer" }, + attrs: { property: "og:image:alt", content: OG_ALT }, }, { tag: "meta", @@ -75,15 +76,15 @@ export default defineConfig({ { "@type": "WebSite", "@id": "https://beta-docs.internetcomputer.org/#website", - "name": "ICP Developer Docs", - "description": "Developer documentation for building full-stack web applications, DeFi protocols, and cross-chain integrations on the Internet Computer.", + "name": TITLE, + "description": DESCRIPTION, "url": "https://beta-docs.internetcomputer.org", "publisher": { "@id": "https://beta-docs.internetcomputer.org/#organization" }, }, { "@type": "Organization", "@id": "https://beta-docs.internetcomputer.org/#organization", - "name": "DFINITY Foundation", + "name": PUBLISHER, "url": "https://dfinity.org", }, ], diff --git a/plugins/astro-agent-docs.mjs b/plugins/astro-agent-docs.mjs index 5508310b..ddff8204 100644 --- a/plugins/astro-agent-docs.mjs +++ b/plugins/astro-agent-docs.mjs @@ -18,6 +18,7 @@ import { fileURLToPath } from "node:url"; import { glob } from "glob"; import matter from "gray-matter"; import { sidebar } from "../sidebar.mjs"; +import { TITLE, DESCRIPTION, PUBLISHER } from "../src/branding.mjs"; import { extractSnippet } from "./remark-snippet.mjs"; /** @@ -360,9 +361,9 @@ function generateLlmsTxt(pages, siteUrl) { "https://skills.internetcomputer.org/.well-known/skills"; const lines = [ - "# ICP Developer Docs", + `# ${TITLE}`, "", - "> Developer documentation for building full-stack web applications, DeFi protocols, and cross-chain integrations on the Internet Computer.", + `> ${DESCRIPTION}`, "", "## Agent skills", "", @@ -552,11 +553,11 @@ export default function agentDocs() { '', '', " ", - " ICP Developer Docs", + ` ${escapeXml(TITLE)}`, ` ${base}/`, - " Developer documentation for building full-stack web applications, DeFi protocols, and cross-chain integrations on the Internet Computer.", + ` ${escapeXml(DESCRIPTION)}`, " en-us", - " DFINITY Foundation", + ` ${escapeXml(PUBLISHER)}`, ` ${new Date().toUTCString()}`, channelPubDate ? ` ${new Date(channelPubDate.date).toUTCString()}` @@ -574,7 +575,7 @@ export default function agentDocs() { ? ` ${new Date(item.date).toUTCString()}` : "", ` ${item.url}`, - " DFINITY Foundation", + ` ${escapeXml(PUBLISHER)}`, " ", ] .filter(Boolean) diff --git a/src/branding.mjs b/src/branding.mjs new file mode 100644 index 00000000..b4e328af --- /dev/null +++ b/src/branding.mjs @@ -0,0 +1,8 @@ +// Shared branding strings used across astro.config.mjs and build-time plugins. +// Edit here to change site title, description, or publisher everywhere. + +export const TITLE = "ICP Developer Docs"; +export const DESCRIPTION = + "Developer documentation for building full-stack web applications, digital assets and payments, and cross-chain integrations on the Internet Computer."; +export const PUBLISHER = "DFINITY Foundation"; +export const OG_ALT = "ICP Developer Docs: build on the Internet Computer";