Skip to content

Commit 284b1fc

Browse files
doc: add sitemap
1 parent e3ad2c2 commit 284b1fc

File tree

3 files changed

+36
-35
lines changed

3 files changed

+36
-35
lines changed

apps/docs/astro.config.mjs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import sitemap from "@astrojs/sitemap";
12
import starlight from "@astrojs/starlight";
23
import tailwind from "@astrojs/tailwind";
34
// @ts-check
45
import { defineConfig, passthroughImageService } from "astro/config";
5-
import { fetchStories, storybookLoader } from "./src/storybook-loader.ts";
6-
// No access to `getCollection` here, use loader
6+
import { fetchStories } from "./src/storybook-loader.ts";
7+
8+
const PUBLIC_DOC_SITE_URL = "https://ddev-storybook.geist.network";
79

8-
// sidebar use docs collection as default, model as external link
910
export const getSidebarComponentsSlugs = async () => {
1011
const entries = await fetchStories();
1112
// Group entries by their title parts
@@ -22,6 +23,7 @@ export const getSidebarComponentsSlugs = async () => {
2223

2324
acc[group][subgroup].push({
2425
label: name,
26+
// model as external link as slug only applicable to doc
2527
link: `/component/${id}`,
2628
});
2729

@@ -42,6 +44,7 @@ const components = await getSidebarComponentsSlugs();
4244

4345
// https://astro.build/config
4446
export default defineConfig({
47+
site: PUBLIC_DOC_SITE_URL,
4548
integrations: [
4649
starlight({
4750
title: "dDevKit",
@@ -76,14 +79,12 @@ export default defineConfig({
7679
],
7780
favicon: "/favicon.svg",
7881
}),
82+
sitemap(),
7983
tailwind({
8084
// Disable the default base styles:
8185
applyBaseStyles: true,
8286
}),
8387
],
84-
// adapter: cloudflare({
85-
// imageService: "cloudflare",
86-
// }),
8788
image: {
8889
service: passthroughImageService(),
8990
},

apps/docs/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@astrojs/cloudflare": "^12.2.1",
15+
"@astrojs/sitemap": "^3.3.0",
1516
"@astrojs/starlight": "^0.31.1",
1617
"@astrojs/starlight-tailwind": "^3.0.1",
1718
"@astrojs/tailwind": "^6.0.2",

pnpm-lock.yaml

+28-29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)