Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
24 KiB
@astrojs/sitemap
3.6.0
Minor Changes
-
#14285
bedc31bThanks @jdcolombo! - Adds a new configuration optionnamespacesfor more control over XML namespaces used in sitemap generationExcluding unused namespaces can help create cleaner, more focused sitemaps that are faster for search engines to parse and use less bandwidth. If your site doesn't have news content, videos, or multiple languages, you can exclude those namespaces to reduce XML bloat.
The
namespacesoption allows you to configurenews,xhtml,image, andvideonamespaces independently. All namespaces are enabled by default for backward compatibility and no change to existing projects is necessary. But now, you can choose to streamline your XML and avoid unnecessary code.For example, to exclude the video namespace from your sitemap, set
video: falsein your configuration:// astro.config.mjs import { sitemap } from '@astrojs/sitemap'; export default { integrations: [ sitemap({ namespaces: { video: false, // other namespaces remain enabled by default } }) ] };The generated XML will not include the
xmlns:videonamespace:<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" > <!-- ... --> </urlset>
3.5.1
Patch Changes
- #14233
896886cThanks @gouravkhunger! - Fixes the issue with the optionlastmodwhere if it is defined it applies correctly to<url>entries in eachsitemap-${i}.xmlfile but not the<sitemap>entries in the rootsitemap-index.xmlfile.
3.5.0
Minor Changes
-
#13682
5824b32Thanks @gouravkhunger! - Adds acustomSitemapsoption to include extra sitemaps in thesitemap-index.xmlfile generated by Astro.This is useful for multi-framework setups on the same domain as your Astro site (
example.com), such as a blog atexample.com/blogwhose sitemap is generated by another framework.The following example shows configuring your Astro site to include sitemaps for an externally-generated blog and help center along with the generated sitemap entries in
sitemap-index.xml:Example:
import { defineConfig } from 'astro/config'; import sitemap from '@astrojs/sitemap'; export default defineConfig({ site: 'https://example.com', integrations: [ sitemap({ customSitemaps: [ 'https://example.com/blog/sitemap.xml', 'https://example.com/helpcenter/sitemap.xml', ], }), ], });Learn more in the
@astrojs/sitemapconfiguration documentation.
3.4.2
Patch Changes
- #14127
2309adaThanks @florian-lefebvre! - Upgrades zod
3.4.1
Patch Changes
- #13871
8a1e849Thanks @blimmer! - Uncaught errors in thefiltermethod will now bubble, causing the astro build to fail.
3.4.0
Minor Changes
-
#13753
90293deThanks @mattyoho! - Customize the filenames of sitemap XML files generated by the@astro/sitemapintegration by settingfilenameBasein the integration configuration settings. This may be useful when deploying an Astro site at a path on a domain with preexisting sitemap files.Generated sitemap files will appear at
/sitemap-0.xmland/sitemap-index.xmlby default, which may conflict with preexisting files. SetfilenameBaseto a custom value to avoid that if so:import { defineConfig } from 'astro/config'; import sitemap from '@astrojs/sitemap'; export default defineConfig({ site: 'https://example.com', integrations: [ sitemap({ filenameBase: 'astronomy-sitemap', }), ], });This will yield sitemap and index files as
https://example.com/astronomy-sitemap-0.xmlandhttps://example.com/astronomy-sitemap-index.xml.
3.3.1
Patch Changes
- #13591
5dd2d3fThanks @florian-lefebvre! - Removes unused code
3.3.0
Minor Changes
- #13448
91c9503Thanks @ematipico! - Add support for XSL in sitemap-index.xml
3.2.1
Patch Changes
- #12156
07754f5Thanks @mingjunlu! - Adds missingxslURLproperty toSitemapOptionstype.
3.2.0
Minor Changes
3.1.6
Patch Changes
3.1.5
Patch Changes
- #10779
cefeadfThanks @adrianlyjak! - Fixes false positives for status code routes like404and500when generating sitemaps.
3.1.4
Patch Changes
- #10772
0e22462d1534afc8f7bb6782f86db680c7a5f245Thanks @gislerro! - Fixes an issue where the root url does not follow thetrailingSlashconfig option
3.1.3
Patch Changes
- #10795
1ce22881c657becf0397b83ac393fb5d2399104cThanks @bluwy! - Improves performance when generating the sitemap data
3.1.2
Patch Changes
- #10557
5f7e9c47e01116f6ec74b33770f480404680956aThanks @mingjunlu! - Fixes an issue where the base path is missing insitemap-index.xml.
3.1.1
Patch Changes
-
#10179
6343f6a438d790fa16a0dd268f4a51def4fa0f33Thanks @ematipico! - Revert https://github.com/withastro/astro/pull/9846The feature to customize the file name of the sitemap was reverted due to some internal issues with one of the dependencies. With an non-deterministic behaviour, the sitemap file was sometime emitted with incorrect syntax.
-
#9975
ec7d2ebbd96b8c2dfdadaf076bbf7953007536edThanks @moose96! - Fixes URL generation for routes that rest parameters and start with/
3.1.0
Minor Changes
-
#9846
9b78c992750cdb99c40a89a00ea2a0d1c00877d7Thanks @ktym4a! - Adds a new configuration optionprefixthat allows you to change the defaultsitemap-*.xmlfile name.By default, running
astro buildcreates bothsitemap-index.xmlandsitemap-0.xmlin your output directory.To change the names of these files (e.g. to
astrosite-index.xmlandastrosite-0.xml), set theprefixoption in yoursitemapintegration configuration:import { defineConfig } from 'astro/config'; import sitemap from '@astrojs/sitemap'; export default defineConfig({ site: 'https://example.com', integrations: [ sitemap({ prefix: 'astrosite-', }), ], });This option is useful when Google Search Console is unable to fetch your default sitemap files, but can read renamed files.
3.0.5
Patch Changes
- #9704
b325fada567892b63ecae87c1ff845c8514457baThanks @andremralves! - Fixes generated URLs when using abasewith a SSR adapter
3.0.4
Patch Changes
- #9479
1baf0b0d3cbd0564954c2366a7278794fad6726eThanks @sarah11918! - Updates README
3.0.3
Patch Changes
- #8762
35cd810f0Thanks @evadecker! - Upgrades Zod to 3.22.4
3.0.2
Patch Changes
- #8824
10b103820Thanks @silent1mezzo! - Display output directory in the sitemap build result
3.0.1
Patch Changes
- #8737
6f60da805Thanks @ematipico! - Add provenance statement when publishing the library from CI
3.0.0
Major Changes
-
#8188
d0679a666Thanks @ematipico! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023. -
#8179
6011d52d3Thanks @matthewp! - Astro 3.0 Release Candidate
3.0.0-rc.1
Major Changes
3.0.0-beta.0
Major Changes
1eae2e3f7Thanks @Princesseuh! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.
2.0.2
Patch Changes
2.0.1
Patch Changes
- #7722
77ffcc8f8Thanks @natemoo-re! - Ensure nested 404 and 500 pages are always excluded
2.0.0
Major Changes
- #7656
dd931a780Thanks @natemoo-re! - Sitemap only includespageroutes (generated by.astrofiles) rather than all routes (pages, endpoints, or redirects). This behavior matches our existing documentation, but is a breaking change nonetheless.
Patch Changes
- #7656
dd931a780Thanks @natemoo-re! - Ensure trailing slash is only added to page routes
1.4.0
Minor Changes
- #7655
c258492b7Thanks @natemoo-re! - Ensure sitemap only excludes numerical pages matching/404and/500exactly
1.3.3
Patch Changes
- #7263
dff0d0ddaThanks @andremralves! - Fix sitemap does not filter pages
1.3.2
Patch Changes
- #7028
6ca3b5a9eThanks @alexanderniebuhr! - exported enum type to support typescript > 5.0
1.3.1
Patch Changes
- #7029
1b90a7a5dThanks @TheOtterlord! - Fix generation for static dynamic routes
1.3.0
Minor Changes
- #6534
ad907196cThanks @atilafassina! - Adds support to SSR routes to sitemap generation.
1.2.2
Patch Changes
- #6658
1ec1df126Thanks @andremralves! - Fix sitemap generation with a base path
1.2.1
Patch Changes
- #6494
a13e9d7e3Thanks @Yan-Thomas! - Consistency improvements to several package descriptions
1.2.0
Minor Changes
- #6213
afbbc4d5bThanks @Princesseuh! - Updated compilation settings to disable downlevelling for Node 14
1.1.0
Minor Changes
- #6262
4fcefa34fThanks @vic1707! - updateChangeFreqto support typescript configurations with string literal or predefined value.
1.0.1
Patch Changes
1.0.0
Major Changes
-
04ad44563- > Astro v1.0 is out! Read the official announcement post.No breaking changes. This package is now officially stable and compatible with
astro@1.0.0!
0.3.0
Minor Changes
-
#4015
6fd161d76Thanks @matthewp! - Newoutputconfiguration optionThis change introduces a new "output target" configuration option (
output). Setting the output target lets you decide the format of your final build, either:"static"(default): A static site. Your final build will be a collection of static assets (HTML, CSS, JS) that you can deploy to any static site host."server": A dynamic server application. Your final build will be an application that will run in a hosted server environment, generating HTML dynamically for different requests.
If
outputis omitted from your config, the default value"static"will be used.When using the
"server"output target, you must also include a runtime adapter via theadapterconfiguration. An adapter will adapt your final build to run on the deployed platform of your choice (Netlify, Vercel, Node.js, Deno, etc).To migrate: No action is required for most users. If you currently define an
adapter, you will need to also addoutput: 'server'to your config file to make it explicit that you are building a server. Here is an example of what that change would look like for someone deploying to Netlify:import { defineConfig } from 'astro/config'; import netlify from '@astrojs/netlify/functions'; export default defineConfig({ adapter: netlify(), + output: 'server', });
Patch Changes
- #3978
b37d7078aThanks @Chrissdroid! - Update README to reflect@astrojs/sitemap@0.2.0changes
- #4004
ef9c4152bThanks @sarah11918! - [READMEs] removed "experimental" from astro add instructions
0.2.6
Patch Changes
0.2.5
Patch Changes
- #3854
b012ee55Thanks @bholmesdev! - [astro add] Support adapters and third party packages
0.2.4
Patch Changes
0.2.3
Patch Changes
- #3723
52f75369Thanks @alextim! - fix: ifserializefunction returnsundefinedfor the passed entry, such entry will be excluded from sitemap
0.2.2
Patch Changes
- #3689
3f8ee70eThanks @bholmesdev! - Add warning log for sitemap + SSR adapter, with suggestion to use customPages configuration option
0.2.1
Patch Changes
0.2.0
Minor Changes
-
#3579
1031c06fThanks @alextim! - # Key features- Split up your large sitemap into multiple sitemaps by custom limit.
- Ability to add sitemap specific attributes such as
lastmodetc. - Final output customization via JS function.
- Localization support.
- Reliability: all config options are validated.
Important changes
The integration always generates at least two files instead of one:
sitemap-index.xml- index file;sitemap-{i}.xml- actual sitemap.
0.1.2
Patch Changes
0.1.1
Patch Changes
- #3553
c601ce59Thanks @caioferrarezi! - Prevent sitemap URLs with trimmed paths
0.1.0
Minor Changes
e425f896Thanks @FredKSchott! - Update config options to respect RFC0019
Patch Changes
e425f896Thanks @FredKSchott! - Add new sitemap configuration options:filter: filter pages to include in your sitemapcanonicalURL: override your astro.configsitewith a custom base URL
0.0.2
Patch Changes
- #2885
6b004363Thanks @bholmesdev! - Add README across Astro built-in integrations
- #2847
3b621f7aThanks @tony-sull! - Adds keywords to the official integrations to support discoverability on Astro's Integrations site
0.0.2-next.0
Patch Changes
- #2847
3b621f7aThanks @tony-sull! - Adds keywords to the official integrations to support discoverability on Astro's Integrations site