Skip to content

Commit ec4be00

Browse files
committed
Add sitemap, robots.txt, canonical URLs, and JSON-LD structured data
- @astrojs/sitemap integration → sitemap-index.xml at build time - public/robots.txt pointing at the sitemap - rel=canonical on every page, always resolving to the production domain so Cloudflare Pages preview deployments don't compete in search indexes - JSON-LD: WebSite + SoftwareSourceCode on every page, plus a BreadcrumbList on component pages - Canonical domain switched from antadesign.dev to anta.design everywhere: astro.config site, llms.txt/llms-full.txt, docs https://claude.ai/code/session_014L7DSpJXPXNJ3qe2R1AMH7
1 parent 1ba57db commit ec4be00

11 files changed

Lines changed: 109 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to the `@antadesign/anta` package are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project tries to follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5-
This file only tracks what ships to npm consumers — anything under `src/`, `dist/`, the build / generator scripts, and root files in the published tarball. Updates to the documentation site at `antadesign.dev` are not consumer-facing and are intentionally not in this changelog; see the commit history for the site narrative.
5+
This file only tracks what ships to npm consumers — anything under `src/`, `dist/`, the build / generator scripts, and root files in the published tarball. Updates to the documentation site at `anta.design` are not consumer-facing and are intentionally not in this changelog; see the commit history for the site narrative.
66

77
Versions ending in `-dev.N` are pre-release builds published under the npm `dev` dist-tag; main releases drop the suffix. Always pin a specific version in your `package.json` (`"@antadesign/anta": "0.1.1-dev.1"`) rather than the floating `"dev"` tag — the floating tag tracks the latest dev build and will silently change between installs.
88

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Each version string is immutable on npm — always bump before publishing.
8383

8484
## Changelog
8585

86-
`CHANGELOG.md` at the repo root documents changes to **the `@antadesign/anta` package only** — code shipped to npm consumers (anything under `src/` and `dist/`, plus root files in the published tarball). The docs site under `site/` is its own thing and **does not** belong in the changelog. New site pages, component-docs polish, demos, layout tweaks — all of that ships only on `antadesign.dev` and isn't a consumer-facing change.
86+
`CHANGELOG.md` at the repo root documents changes to **the `@antadesign/anta` package only** — code shipped to npm consumers (anything under `src/` and `dist/`, plus root files in the published tarball). The docs site under `site/` is its own thing and **does not** belong in the changelog. New site pages, component-docs polish, demos, layout tweaks — all of that ships only on `anta.design` and isn't a consumer-facing change.
8787

8888
When in doubt: would a consumer who installs this version see this change in their app? If no, leave it out of `CHANGELOG.md`. Use commit messages and PR descriptions for the docs-site narrative.
8989

pnpm-lock.yaml

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Anta docs site (`site/`)
22

3-
This is the documentation site for `@antadesign/anta`, deployed at antadesign.dev. It is **not** part of the published npm package — anything that ships to consumers lives in the repo root (`src/`, `dist/`).
3+
This is the documentation site for `@antadesign/anta`, deployed at anta.design. It is **not** part of the published npm package — anything that ships to consumers lives in the repo root (`src/`, `dist/`).
44

55
Stack: Astro 5 static output, Preact islands (`@astrojs/preact`, with `compat: true` so `react` aliases to `preact/compat`), MDX for component pages, astro-expressive-code for syntax-highlighted code blocks, Monaco editor for the interactive playground.
66

site/astro.config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'astro/config';
22
import preact from '@astrojs/preact';
33
import mdx from '@astrojs/mdx';
4+
import sitemap from '@astrojs/sitemap';
45
import astroExpressiveCode, { createInlineSvgUrl } from 'astro-expressive-code';
56
import remarkGfm from 'remark-gfm';
67
import remarkMath from 'remark-math';
@@ -24,7 +25,7 @@ import { fileURLToPath } from 'node:url';
2425
const reactCompatShim = fileURLToPath(new URL('./lib/react-compat-shim.mjs', import.meta.url));
2526

2627
export default defineConfig({
27-
site: 'https://antadesign.dev',
28+
site: 'https://anta.design',
2829
devToolbar: { enabled: false },
2930
integrations: [
3031
// compat:false — we install the react→preact/compat aliases ourselves in
@@ -84,6 +85,7 @@ export default defineConfig({
8485
},
8586
}),
8687
mdx(),
88+
sitemap(),
8789
],
8890
vite: {
8991
// With the preset's compat off, replicate the dedupe/SSR-bundling it would

site/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@antadesign/anta": "workspace:*",
1717
"@astrojs/mdx": "4.3.14",
1818
"@astrojs/preact": "4.1.3",
19+
"@astrojs/sitemap": "^3.7.3",
1920
"@monaco-editor/react": "4.7.0",
2021
"@shikijs/monaco": "3.23.0",
2122
"astro": "5.18.1",

site/public/robots.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
User-agent: *
2+
Allow: /
3+
4+
Sitemap: https://anta.design/sitemap-index.xml
5+
6+
# LLM-friendly documentation
7+
# https://anta.design/llms.txt
8+
# https://anta.design/llms-full.txt

site/src/layouts/DocsLayout.astro

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,48 @@ try {
3535
}
3636
} catch {}
3737
38-
// Resolve URLs against the site config (https://antadesign.dev) so
39-
// Open Graph / Twitter crawlers receive absolute URLs.
38+
// Resolve URLs against the site config (https://anta.design) so
39+
// Open Graph / Twitter crawlers receive absolute URLs, and the canonical
40+
// link always points at the production domain — Cloudflare Pages preview
41+
// deployments (*.pages.dev) serve identical content and would otherwise
42+
// compete in search indexes.
4043
const ogImage = new URL('/og-image.png', Astro.site).href
4144
const pageUrl = new URL(Astro.url.pathname, Astro.site).href
4245
const pageTitle = title ? `${title} — Anta` : 'Anta'
4346
const description = "Antithesis design system: global CSS tokens, framework-agnostic web components, and JSX wrappers for React and Preact."
47+
48+
// JSON-LD structured data. Every page declares the WebSite; component
49+
// pages add a breadcrumb trail so search results show the site hierarchy.
50+
const isComponentPage = /^\/components\/[^/]+\/?$/.test(Astro.url.pathname)
51+
const jsonLd: object[] = [
52+
{
53+
'@context': 'https://schema.org',
54+
'@type': 'WebSite',
55+
name: 'Anta',
56+
url: new URL('/', Astro.site).href,
57+
description,
58+
},
59+
{
60+
'@context': 'https://schema.org',
61+
'@type': 'SoftwareSourceCode',
62+
name: '@antadesign/anta',
63+
description,
64+
url: new URL('/', Astro.site).href,
65+
codeRepository: 'https://github.com/antithesishq/anta',
66+
programmingLanguage: 'TypeScript',
67+
runtimePlatform: ['React', 'Preact'],
68+
},
69+
]
70+
if (isComponentPage && title) {
71+
jsonLd.push({
72+
'@context': 'https://schema.org',
73+
'@type': 'BreadcrumbList',
74+
itemListElement: [
75+
{ '@type': 'ListItem', position: 1, name: 'Anta', item: new URL('/', Astro.site).href },
76+
{ '@type': 'ListItem', position: 2, name: title, item: pageUrl },
77+
],
78+
})
79+
}
4480
---
4581

4682
<html lang="en">
@@ -49,6 +85,9 @@ const description = "Antithesis design system: global CSS tokens, framework-agno
4985
<meta name="viewport" content="width=device-width, initial-scale=1" />
5086
<title>{pageTitle}</title>
5187
<meta name="description" content={description} />
88+
<link rel="canonical" href={pageUrl} />
89+
<link rel="sitemap" href="/sitemap-index.xml" />
90+
<script type="application/ld+json" set:html={JSON.stringify(jsonLd)} />
5291
<link rel="icon" type="image/svg+xml" href="/anta-favicon.svg" />
5392
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
5493

site/src/pages/components/tooltip.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ or `interactive` to make it hoverable and clickable (for content like links).
3737
</Button>
3838
<Button label="Interact">
3939
<Tooltip interactive placement="top">
40-
See the <a href="https://antadesign.dev/">full guide</a> for details
40+
See the <a href="https://anta.design/">full guide</a> for details
4141
</Tooltip>
4242
</Button>
4343
</div>

site/src/pages/llms-full.txt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { APIRoute } from 'astro'
22
import { renderPropsTable } from '../../lib/llms/props-from-api.ts'
33
import { parseMdx } from '../../lib/llms/parse-mdx.ts'
44

5-
const SITE = 'https://antadesign.dev'
5+
const SITE = 'https://anta.design'
66

77
const componentModules = import.meta.glob('./components/*.mdx', {
88
eager: true,

0 commit comments

Comments
 (0)