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
17 changes: 4 additions & 13 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import nimbus, {
} from "@cloudflare/nimbus-docs";
import { satteri } from "@astrojs/markdown-satteri";
import { hastPlugins } from "./src/plugins/satteri";
import { createSitemapLastmodSerializer } from "./sitemap.serializer";
import { isDisallowedByRobots } from "./src/util/robots";

// One sidebar section per top-level product directory, autogenerated from the
Expand Down Expand Up @@ -54,12 +53,6 @@ async function getExternalLinkPaths(dir: string): Promise<Set<string>> {

const sidebarItems = await autogenSections();
const externalLinkPaths = await getExternalLinkPaths("src/content/docs");
// Previews build from a shallow clone, so git dates are wrong, and any
// per-build date forces every page to be re-uploaded. `astro:env` isn't
// available here; unset means preview, matching the env schema default.
const serializeSitemapLastmod = createSitemapLastmodSerializer({
lastmod: process.env.DEPLOYMENT_ENV === "production",
});

// Mirrors production's sitemap `filter` (root astro.config.ts).
function isExcludedFromSitemap(url: string): boolean {
Expand Down Expand Up @@ -223,15 +216,13 @@ const integrations = [
},
},
validateMdx: false,
// Sitemap parity (T3): drop excluded URLs, stamp lastmod on the rest.
// Nimbus sets `lastmod` from frontmatter or git; here we drop excluded
// URLs and escape `@` in the rest.
sitemap: {
serialize: async (item) =>
serialize: (item) =>
isExcludedFromSitemap(item.url)
? undefined
: serializeSitemapLastmod(
// nominal-only gap between nimbus-docs and @astrojs/sitemap types
item as Parameters<typeof serializeSitemapLastmod>[0],
),
: { ...item, url: item.url.replace(/@/g, "%40") },
},
rules: {
"nimbus/frontmatter-shape": "error",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@base-ui/react": "1.9.0",
"@cloudflare/ai-search-snippet": "0.0.43",
"@cloudflare/config": "0.25.0",
"@cloudflare/nimbus-docs": "0.17.0",
"@cloudflare/nimbus-docs": "0.18.1",
"@cloudflare/vitest-plugin": "1.4.3",
"@cloudflare/workers-types": "5.20261013.1",
"@eslint/js": "9.39.4",
Expand Down
140 changes: 34 additions & 106 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading