diff --git a/.changeset/sitemap-drop-lastmod.md b/.changeset/sitemap-drop-lastmod.md new file mode 100644 index 000000000..7b0fdff9c --- /dev/null +++ b/.changeset/sitemap-drop-lastmod.md @@ -0,0 +1,5 @@ +--- +"@tabler/preview": patch +--- + +Removed the `` element from `sitemap.xml`, which carried the build time instead of a content date. diff --git a/preview/pages/sitemap.xml.ts b/preview/pages/sitemap.xml.ts index c1da3064c..3d4b576e0 100644 --- a/preview/pages/sitemap.xml.ts +++ b/preview/pages/sitemap.xml.ts @@ -25,13 +25,12 @@ const escapeXml = (value: string) => value.replace(/&/g, '&').replace(/ { const environment = process.env.NODE_ENV || 'production' const baseUrl = environment !== 'development' ? site.previewUrl : '' - // ISO 8601 UTC timestamp (+00:00 suffix) - const lastModified = new Date().toISOString().replace(/\.\d{3}Z$/, '+00:00') + // No : it is optional, and stamping every url with the build time + // said nothing about the pages while making the file differ on every build. const entries = urls .map( (url) => ` ${escapeXml(`${baseUrl}${url}`)} - ${lastModified} `, ) .join('\n')