From 2feaee11d85d857d5f24d0b1a6a76cda8080d403 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 11 Sep 2025 18:52:48 +0200 Subject: [PATCH 1/3] fix(integrations-guide/sitemap): add API references on Configuration --- .../en/guides/integrations-guide/sitemap.mdx | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/content/docs/en/guides/integrations-guide/sitemap.mdx b/src/content/docs/en/guides/integrations-guide/sitemap.mdx index 930c1c8251933..23e6b002cf0d5 100644 --- a/src/content/docs/en/guides/integrations-guide/sitemap.mdx +++ b/src/content/docs/en/guides/integrations-guide/sitemap.mdx @@ -195,6 +195,11 @@ export default defineConfig({ ### filter +

+ +**Type:** `(page: string) => boolean` +

+ All pages are included in your sitemap by default. By adding a custom `filter` function, you can filter included pages by URL. ```js title="astro.config.mjs" ins={8} @@ -235,6 +240,11 @@ export default defineConfig({ ### customPages +

+ +**Type:** `string[]` +

+ An array of externally-generated pages to be included in the generated sitemap file. Use this option to include pages in your sitemap that are a part of your deployed site but are not created by Astro. @@ -282,6 +292,12 @@ export default defineConfig({ ### entryLimit +

+ +**Type:** `number`
+**Default:** `45000` +

+ The maximum number entries per sitemap file. The default value is 45000. A sitemap index and multiple sitemaps are created if you have more entries. See this [explanation of splitting up a large sitemap](https://developers.google.com/search/docs/advanced/sitemaps/large-sitemaps). ```js title="astro.config.mjs" ins={8} @@ -300,6 +316,12 @@ export default defineConfig({ ### changefreq, lastmod, and priority +

+ +**Type:** `{ changefreq?: ChangeFreq; lastmod?: Date; priority?: number; }` + +

+ These options correspond to the ``, ``, and `` tags in the [Sitemap XML specification.](https://www.sitemaps.org/protocol.html) Note that `changefreq` and `priority` are ignored by Google. @@ -326,6 +348,11 @@ export default defineConfig({ ### serialize +

+ +**Type:** `(item: SitemapItem) => SitemapItem | Promise | undefined` +

+ A function called for each sitemap entry just before writing to a disk. This function can be asynchronous. It receives as its parameter a `SitemapItem` object that can have these properties: @@ -370,6 +397,11 @@ export default defineConfig({ ### i18n +

+ +**Type:** `{ defaultLocale: string; locales: Record; }` +

+ To localize a sitemap, pass an object to this `i18n` option. This object has two required properties: @@ -435,6 +467,12 @@ The resulting sitemap looks like this: ### xslURL +

+ +**Type:** `string`
+ +

+ The URL of an XSL stylesheet to style and prettify your sitemap. The value set can be either a path relative to your configured `site` URL for a local stylesheet, or can be an absolute URL link to an external stylesheet. @@ -455,6 +493,13 @@ export default defineConfig({ ### filenameBase +

+ +**Type:** `string`
+**Default:** `sitemap`
+ +

+ The name prefix string used when generating the sitemap XML files. The default value is `sitemap`. This option may be useful when integrating an Astro site into a domain with preexisting sitemap files. From 473040660be9d6491784899ec5bc2735a9ddbae5 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 11 Sep 2025 19:22:00 +0200 Subject: [PATCH 2/3] move read more links inside text --- .../docs/en/guides/integrations-guide/sitemap.mdx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/content/docs/en/guides/integrations-guide/sitemap.mdx b/src/content/docs/en/guides/integrations-guide/sitemap.mdx index 23e6b002cf0d5..518bf95bab7bc 100644 --- a/src/content/docs/en/guides/integrations-guide/sitemap.mdx +++ b/src/content/docs/en/guides/integrations-guide/sitemap.mdx @@ -402,16 +402,12 @@ export default defineConfig({ **Type:** `{ defaultLocale: string; locales: Record; }`

-To localize a sitemap, pass an object to this `i18n` option. +To [localize a sitemap](https://developers.google.com/search/docs/advanced/crawling/localized-versions#all-method-guidelines), pass an object to this `i18n` option. This object has two required properties: -* `defaultLocale`: `String`. Its value must exist as one of `locales` keys. -* `locales`: `Record`, key/value - pairs. The key is used to look for a locale part in a page path. The value is a language attribute, only English alphabet and hyphen allowed. - -[Read more about language attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang). - -[Read more about localization](https://developers.google.com/search/docs/advanced/crawling/localized-versions#all-method-guidelines). +* `defaultLocale`: Its value must exist as one of `locales` keys. +* `locales`: key/value - pairs. The key is used to look for a locale part in a page path. The value is a [language attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang), only English alphabet and hyphen allowed. ```js title="astro.config.mjs" ins={8-15} import { defineConfig } from 'astro/config'; From 228cfdcc94792e61c4a2cb96ba15e7c785b9f9cd Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 12 Sep 2025 14:08:16 +0200 Subject: [PATCH 3/3] fix: use backticks around config options headings --- .../en/guides/integrations-guide/sitemap.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/content/docs/en/guides/integrations-guide/sitemap.mdx b/src/content/docs/en/guides/integrations-guide/sitemap.mdx index 518bf95bab7bc..a66afc08b3fe6 100644 --- a/src/content/docs/en/guides/integrations-guide/sitemap.mdx +++ b/src/content/docs/en/guides/integrations-guide/sitemap.mdx @@ -193,7 +193,7 @@ export default defineConfig({ }); ``` -### filter +### `filter`

@@ -238,7 +238,7 @@ export default defineConfig({ }); ``` -### customPages +### `customPages`

@@ -263,7 +263,7 @@ export default defineConfig({ }); ``` -### customSitemaps +### `customSitemaps`

@@ -290,7 +290,7 @@ export default defineConfig({ }); ``` -### entryLimit +### `entryLimit`

@@ -314,7 +314,7 @@ export default defineConfig({ }); ``` -### changefreq, lastmod, and priority +### `changefreq`, `lastmod`, and `priority`

@@ -346,7 +346,7 @@ export default defineConfig({ }); ``` -### serialize +### `serialize`

@@ -395,7 +395,7 @@ export default defineConfig({ }); ``` -### i18n +### `i18n`

@@ -461,7 +461,7 @@ The resulting sitemap looks like this: ... ``` -### xslURL +### `xslURL`

@@ -487,7 +487,7 @@ export default defineConfig({ }); ``` -### filenameBase +### `filenameBase`