github withastro/astro @astrojs/sitemap@3.7.0

latest release: @astrojs/vercel@9.0.4
9 hours ago

Minor Changes

  • #14471 4296373 Thanks @Slackluky! - Adds the ability to split sitemap generation into chunks based on customizable logic. This allows for better management of large sitemaps and improved performance. The new chunks option in the sitemap configuration allows users to define functions that categorize sitemap items into different chunks. Each chunk is then written to a separate sitemap file.

    integrations: [
      sitemap({
        serialize(item) { th
          return item
        },
        chunks: { // this property will be treated last on the configuration
          'blog': (item) => {  // will produce a sitemap file with `blog` name (sitemap-blog-0.xml)
            if (/blog/.test(item.url)) { // filter path that will be included in this specific sitemap file
              item.changefreq = 'weekly';
              item.lastmod = new Date();
              item.priority = 0.9; // define specific properties for this filtered path
              return item;
            }
          },
          'glossary': (item) => {
            if (/glossary/.test(item.url)) {
              item.changefreq = 'weekly';
              item.lastmod = new Date();
              item.priority = 0.7;
              return item;
            }
          }
    
          // the rest of the path will be stored in `sitemap-pages.0.xml`
        },
      }),
    ],
    
    

Don't miss a new astro release

NewReleases is sending notifications on new releases.