Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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",
Expand All @@ -42,7 +43,7 @@ export default defineConfig({
attrs: {
rel: "alternate",
type: "application/rss+xml",
title: "ICP Developer Docs",
title: TITLE,
href: "/feed.xml",
},
},
Expand All @@ -52,15 +53,15 @@ export default defineConfig({
},
{
tag: "meta",
attrs: { name: "author", content: "DFINITY Foundation" },
attrs: { name: "author", content: PUBLISHER },
},
{
tag: "meta",
attrs: { property: "og:image", content: "https://beta-docs.internetcomputer.org/og-image.png" },
},
{
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",
Expand All @@ -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",
},
],
Expand Down
13 changes: 7 additions & 6 deletions plugins/astro-agent-docs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down Expand Up @@ -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",
"",
Expand Down Expand Up @@ -552,11 +553,11 @@ export default function agentDocs() {
'<?xml version="1.0" encoding="UTF-8"?>',
'<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">',
" <channel>",
" <title>ICP Developer Docs</title>",
` <title>${escapeXml(TITLE)}</title>`,
` <link>${base}/</link>`,
" <description>Developer documentation for building full-stack web applications, DeFi protocols, and cross-chain integrations on the Internet Computer.</description>",
` <description>${escapeXml(DESCRIPTION)}</description>`,
" <language>en-us</language>",
" <copyright>DFINITY Foundation</copyright>",
` <copyright>${escapeXml(PUBLISHER)}</copyright>`,
` <lastBuildDate>${new Date().toUTCString()}</lastBuildDate>`,
channelPubDate
? ` <pubDate>${new Date(channelPubDate.date).toUTCString()}</pubDate>`
Expand All @@ -574,7 +575,7 @@ export default function agentDocs() {
? ` <pubDate>${new Date(item.date).toUTCString()}</pubDate>`
: "",
` <guid isPermaLink="true">${item.url}</guid>`,
" <dc:creator>DFINITY Foundation</dc:creator>",
` <dc:creator>${escapeXml(PUBLISHER)}</dc:creator>`,
" </item>",
]
.filter(Boolean)
Expand Down
8 changes: 8 additions & 0 deletions src/branding.mjs
Original file line number Diff line number Diff line change
@@ -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";
Loading