|
| 1 | +import sitemap from "@astrojs/sitemap"; |
1 | 2 | import starlight from "@astrojs/starlight"; |
2 | 3 | import { defineConfig } from "astro/config"; |
3 | 4 |
|
| 5 | +const SITE_URL = "https://simple-stack.dev"; |
| 6 | + |
| 7 | +// Site-wide JSON-LD describing the project as an Organization. |
| 8 | +// Helps AI engines (ChatGPT, Perplexity, Google AI Overviews) attribute |
| 9 | +// citations and disambiguate the brand. |
| 10 | +const organizationJsonLd = { |
| 11 | + "@context": "https://schema.org", |
| 12 | + "@type": "Organization", |
| 13 | + name: "Simple Stack", |
| 14 | + url: SITE_URL, |
| 15 | + logo: `${SITE_URL}/favicon.svg`, |
| 16 | + description: |
| 17 | + "Simple Stack is a suite of small, focused tools for Astro and modern web frameworks, including Simple Store, Simple Scope, and Simple Query.", |
| 18 | + sameAs: [ |
| 19 | + "https://github.com/bholmesdev/simple-stack", |
| 20 | + "https://wtw.dev/chat", |
| 21 | + ], |
| 22 | +}; |
| 23 | + |
4 | 24 | export default defineConfig({ |
| 25 | + site: SITE_URL, |
| 26 | + trailingSlash: "ignore", |
5 | 27 | integrations: [ |
6 | 28 | starlight({ |
7 | 29 | title: "Simple Stack 🌱", |
| 30 | + description: |
| 31 | + "Simple Stack is a suite of small, focused tools for Astro: Simple Store for reactive state, Simple Scope for build-time scoped IDs, and Simple Query for DOM scripting.", |
| 32 | + favicon: "/favicon.svg", |
| 33 | + head: [ |
| 34 | + // Canonical Twitter / OG defaults applied to every page. |
| 35 | + { |
| 36 | + tag: "meta", |
| 37 | + attrs: { name: "twitter:card", content: "summary_large_image" }, |
| 38 | + }, |
| 39 | + { |
| 40 | + tag: "meta", |
| 41 | + attrs: { property: "og:site_name", content: "Simple Stack" }, |
| 42 | + }, |
| 43 | + { |
| 44 | + tag: "meta", |
| 45 | + attrs: { name: "robots", content: "index, follow, max-image-preview:large" }, |
| 46 | + }, |
| 47 | + // Organization structured data for AEO / rich results. |
| 48 | + { |
| 49 | + tag: "script", |
| 50 | + attrs: { type: "application/ld+json" }, |
| 51 | + content: JSON.stringify(organizationJsonLd), |
| 52 | + }, |
| 53 | + ], |
8 | 54 | social: [ |
9 | 55 | { |
10 | 56 | icon: "github", |
@@ -44,5 +90,13 @@ export default defineConfig({ |
44 | 90 | "./src/styles/custom.css", |
45 | 91 | ], |
46 | 92 | }), |
| 93 | + sitemap({ |
| 94 | + // Keep the sitemap aligned with indexable pages only. The deprecated |
| 95 | + // stream and form docs set <meta name="robots" content="noindex">, |
| 96 | + // so they should not be advertised to search engines. |
| 97 | + filter: (page) => |
| 98 | + !page.startsWith(`${SITE_URL}/stream`) && |
| 99 | + !page.startsWith(`${SITE_URL}/form`), |
| 100 | + }), |
47 | 101 | ], |
48 | 102 | }); |
0 commit comments