diff --git a/CLAUDE.md b/CLAUDE.md index 69ea555..05b8ed8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -31,4 +31,5 @@ and rewriting published history have to be asked for by name. - No left-border-only accents on cards; use a full border or a bottom border. - Colours come from `@northguild/theme` tokens. Amber is not used here. - `apps/site` must not extend `tsconfig.base.json`; it extends `astro/tsconfigs/strict`. -- One `robots.txt` serves the whole host, including `/gmt/`. Keep it exactly as is. +- One `robots.txt` serves the whole host, including `/gmt/`. Keep every existing line, + `Content-Signal` included. Add a line only for a new sitemap or a path crawlers should skip. diff --git a/apps/site/astro.config.mjs b/apps/site/astro.config.mjs index 3195acc..8f47e6b 100644 --- a/apps/site/astro.config.mjs +++ b/apps/site/astro.config.mjs @@ -1,7 +1,10 @@ import { defineConfig } from "astro/config"; +import sitemap from "@astrojs/sitemap"; // Static output; the Worker in wrangler.jsonc serves `dist/` as assets only. export default defineConfig({ site: "https://northguild.dev", output: "static", + // @astrojs/sitemap leaves the 404 and 500 pages out of the sitemap itself. + integrations: [sitemap()], }); diff --git a/apps/site/package.json b/apps/site/package.json index 8644fac..44d9cc5 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -10,6 +10,7 @@ "preview": "wrangler dev" }, "dependencies": { + "@astrojs/sitemap": "3.7.4", "@northguild/gmt": "^1.20.0", "@northguild/theme": "workspace:*", "astro": "7.2.7" diff --git a/apps/site/public/logo.png b/apps/site/public/logo.png new file mode 100644 index 0000000..c360a18 Binary files /dev/null and b/apps/site/public/logo.png differ diff --git a/apps/site/public/robots.txt b/apps/site/public/robots.txt index b0a8338..7570d83 100644 --- a/apps/site/public/robots.txt +++ b/apps/site/public/robots.txt @@ -3,5 +3,7 @@ Content-Signal: search=yes, ai-input=yes, ai-train=yes Allow: / Disallow: /api/ Disallow: /mcp/ +Disallow: /gmt/api/ +Sitemap: https://northguild.dev/sitemap-index.xml Sitemap: https://northguild.dev/gmt/sitemap-index.xml diff --git a/apps/site/src/layouts/Base.astro b/apps/site/src/layouts/Base.astro index 58ca76a..27693bd 100644 --- a/apps/site/src/layouts/Base.astro +++ b/apps/site/src/layouts/Base.astro @@ -11,11 +11,19 @@ interface Props { with `.ng-enter-*`, so a page that sets this should stagger them after it. */ entrance?: boolean; + /** Structured data for the page, written as one JSON-LD script. */ + jsonLd?: object; + /** Keeps the page out of search results: writes a robots `noindex` and + no canonical link, so the address cannot be indexed through its + canonical either. */ + noindex?: boolean; } const { title, description = "NorthGuild: open-source tools for developers.", entrance = false, + jsonLd, + noindex = false, } = Astro.props; // Social cards need absolute URLs. @@ -33,7 +41,16 @@ const ogAlt =
There is nothing at this address.
diff --git a/apps/site/src/pages/index.astro b/apps/site/src/pages/index.astro index 440d6e7..0bf3d0c 100644 --- a/apps/site/src/pages/index.astro +++ b/apps/site/src/pages/index.astro @@ -3,6 +3,15 @@ import Base from "../layouts/Base.astro"; import Aurora from "../components/Aurora.astro"; import RepoCard from "../components/RepoCard.astro"; +const organization = { + "@context": "https://schema.org", + "@type": "Organization", + name: "NorthGuild", + url: "https://northguild.dev/", + logo: "https://northguild.dev/logo.png", + sameAs: ["https://github.com/northguild"], +}; + // Descriptions are each package's own `package.json` `description`, verbatim. const repos = [ { @@ -22,7 +31,7 @@ const repos = [ ]; --- -Open-source tools for developers, built in the frigid north.
diff --git a/apps/site/src/scripts/aurora.worker.ts b/apps/site/src/scripts/aurora.worker.ts index 8c7adc0..691480b 100644 --- a/apps/site/src/scripts/aurora.worker.ts +++ b/apps/site/src/scripts/aurora.worker.ts @@ -201,7 +201,9 @@ function siteForTimeZone(): number { /** A frame on a timer, where the worker has no requestAnimationFrame. */ function nextFrameByTimer(cb: FrameRequestCallback): number { - return setTimeout(() => cb(performance.now()), FRAME_MS); + // `self.` keeps the type a number; the bare call is Node's `Timeout` once + // `@types/node` is installed. + return self.setTimeout(() => cb(performance.now()), FRAME_MS); } const nextFrame = diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dbdc0d6..354095c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: apps/site: dependencies: + '@astrojs/sitemap': + specifier: 3.7.4 + version: 3.7.4 '@northguild/gmt': specifier: ^1.20.0 version: 1.20.0 @@ -37,7 +40,7 @@ importers: version: link:../../packages/theme astro: specifier: 7.2.7 - version: 7.2.7(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(yaml@2.9.1) + version: 7.2.7(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@types/node@24.19.2)(yaml@2.9.1) devDependencies: '@astrojs/check': specifier: 0.9.10 @@ -156,6 +159,9 @@ packages: resolution: {integrity: sha512-KTivpmnz6lDsC6o9H4+DNm2SrE/GHzw8cNAvEJwAvUT+eoaEnn/4NtbDNfRRaxaJHdp15gf+tfHAWiXR4wB3BA==} engines: {node: '>=22.12.0'} + '@astrojs/sitemap@3.7.4': + resolution: {integrity: sha512-LbKNC24bdUWcQf/pThB6qLlSqHojxGjZDURIzFocY8rlWnAn2t74nnhnK6S5x0NHriHoAduLEpVjRykmeGiVvA==} + '@astrojs/telemetry@3.3.3': resolution: {integrity: sha512-C1TLn5sPJr0x4vk56piHWKbnqlEB8BKyte5Y45V02U+D7BGO5eMqZDH5aPjnkXQWJggvmsTXxH03QMZ9NgWLzQ==} engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0} @@ -1490,6 +1496,12 @@ packages: '@types/nlcst@2.0.3': resolution: {integrity: sha512-vSYNSDe6Ix3q+6Z7ri9lyWqgGhJTmzRjZRqyq15N0Z/1/UnVsno9G/N40NBijoYx2seFDIl0+B2mgAb9mezUCA==} + '@types/node@24.19.2': + resolution: {integrity: sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==} + + '@types/sax@1.2.7': + resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} + '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} @@ -1558,6 +1570,9 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + arg@5.0.2: + resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} + argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -2228,6 +2243,11 @@ packages: sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + sitemap@9.0.1: + resolution: {integrity: sha512-S6hzjGJSG3d6if0YoF5kTyeRJvia6FSTBroE5fQ0bu1QNxyJqhhinfUsXi9fH3MgtXODWvwo2BDyQSnhPQ88uQ==} + engines: {node: '>=20.19.5', npm: '>=10.8.2'} + hasBin: true + smol-toml@1.9.1: resolution: {integrity: sha512-j7WyPdf0CJoutMzMoPLF/bVXHtKZIT9Rb4eGeEbWw8X2t5oirjPgpL+OpaENZrILYaXqYwnVH+qgUwVbl+pUJQ==} engines: {node: '>= 18'} @@ -2315,6 +2335,9 @@ packages: uncrypto@0.1.3: resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} + undici-types@7.24.6: + resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==} + undici@7.29.0: resolution: {integrity: sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==} engines: {node: '>=20.18.1'} @@ -2779,6 +2802,11 @@ snapshots: dependencies: prismjs: 1.30.0 + '@astrojs/sitemap@3.7.4': + dependencies: + sitemap: 9.0.1 + zod: 4.6.7 + '@astrojs/telemetry@3.3.3': dependencies: ci-info: 4.4.0 @@ -3702,6 +3730,14 @@ snapshots: dependencies: '@types/unist': 3.0.3 + '@types/node@24.19.2': + dependencies: + undici-types: 7.24.6 + + '@types/sax@1.2.7': + dependencies: + '@types/node': 24.19.2 + '@types/unist@3.0.3': {} '@ungap/structured-clone@1.4.0': {} @@ -3788,11 +3824,13 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.2 + arg@5.0.2: {} + argparse@2.0.1: {} aria-query@5.3.2: {} - astro@7.2.7(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(yaml@2.9.1): + astro@7.2.7(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@types/node@24.19.2)(yaml@2.9.1): dependencies: '@astrojs/compiler-rs': 0.4.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) '@astrojs/internal-helpers': 0.10.4 @@ -3842,13 +3880,13 @@ snapshots: ultrahtml: 1.7.0 unifont: 0.7.5 unstorage: 1.17.6 - vite: 8.3.4(esbuild@0.28.2)(yaml@2.9.1) - vitefu: 1.1.3(vite@8.3.4(esbuild@0.28.2)(yaml@2.9.1)) + vite: 8.3.4(@types/node@24.19.2)(esbuild@0.28.2)(yaml@2.9.1) + vitefu: 1.1.3(vite@8.3.4(@types/node@24.19.2)(esbuild@0.28.2)(yaml@2.9.1)) xxhash-wasm: 1.1.0 yargs-parser: 22.0.0 zod: 4.6.7 optionalDependencies: - sharp: 0.35.5 + sharp: 0.35.5(@types/node@24.19.2) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -4559,7 +4597,7 @@ snapshots: '@img/sharp-win32-ia32': 0.35.2 '@img/sharp-win32-x64': 0.35.2 - sharp@0.35.5: + sharp@0.35.5(@types/node@24.19.2): dependencies: '@img/colour': 1.1.0 detect-libc: 2.1.2 @@ -4590,6 +4628,7 @@ snapshots: '@img/sharp-win32-arm64': 0.35.5 '@img/sharp-win32-ia32': 0.35.5 '@img/sharp-win32-x64': 0.35.5 + '@types/node': 24.19.2 optional: true shell-quote@1.12.0: {} @@ -4607,6 +4646,13 @@ snapshots: sisteransi@1.0.5: {} + sitemap@9.0.1: + dependencies: + '@types/node': 24.19.2 + '@types/sax': 1.2.7 + arg: 5.0.2 + sax: 1.6.1 + smol-toml@1.9.1: {} source-map-js@1.2.2: {} @@ -4682,6 +4728,8 @@ snapshots: uncrypto@0.1.3: {} + undici-types@7.24.6: {} + undici@7.29.0: {} undici@8.12.3: {} @@ -4750,7 +4798,7 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite@8.3.4(esbuild@0.28.2)(yaml@2.9.1): + vite@8.3.4(@types/node@24.19.2)(esbuild@0.28.2)(yaml@2.9.1): dependencies: lightningcss: 1.33.0 picomatch: 4.0.7 @@ -4758,13 +4806,14 @@ snapshots: rolldown: 1.2.14 tinyglobby: 0.2.17 optionalDependencies: + '@types/node': 24.19.2 esbuild: 0.28.2 fsevents: 2.3.3 yaml: 2.9.1 - vitefu@1.1.3(vite@8.3.4(esbuild@0.28.2)(yaml@2.9.1)): + vitefu@1.1.3(vite@8.3.4(@types/node@24.19.2)(esbuild@0.28.2)(yaml@2.9.1)): optionalDependencies: - vite: 8.3.4(esbuild@0.28.2)(yaml@2.9.1) + vite: 8.3.4(@types/node@24.19.2)(esbuild@0.28.2)(yaml@2.9.1) volar-service-css@0.0.71(@volar/language-service@2.4.28): dependencies: