SuperStarter automatically generates the sitemap for the website using Next.js’s built-in sitemap generation functionality (sitemap.ts). The generation process scans different directories in the project and creates sitemap entries for various types of content:

Page Collection

If you add new pages or change the routes of your marketing pages, you need to make sure the sitemap reflects these changes.

You can find the configuration for the sitemap in the apps/web/config.ts:

apps/web/config.ts
export const getSitemapConfig: SitemapConfig = {
  staticPages: [
    {
      url: '/contact', // Don't add a domain prefix or a language prefix, we'll take care of that for you.
      changeFrequency: 'monthly',
      priority: 0.8,
    },
  ],
};

Content Collection

The system scans these directories:

Blog Posts

  • Reads all files in the content/blog directory
  • Removes the .mdx extension from filenames

Docs Posts

  • Reads all files in the content/docs directory
  • Removes the .mdx extension from filenames
  • Similarly scans the content/legal directory
  • Removes .mdx extensions

Sitemap Generation

The final sitemap is generated by combining all these routes:

  1. Adds the base URL as the root entry
  2. Adds all page routes defined in the getSitemapConfig object
  3. Adds all blog posts under the blog/ path
  4. Adds all blog posts under the docs/ path
  5. Adds all legal pages under the legal/ path

Each sitemap entry includes:

  • A full URL (combining the base URL with the route)
  • A lastModified timestamp (set to the current date)
The sitemap is automatically regenerated during each build, ensuring it stays up to date with your content.

There is one thing you need to pay attention to, whether you need to set the VERCEL_PROJECT_PRODUCTION_URL environment variable, which will affect the domain of all URL in the sitemap. If your website is deployed on vercel, this variable will be automatically set to the domain name deployed by the project, and you can also manually set it to specify your domain name.

For web application, it could be set like your-domain.com, The value does not include the protocol scheme https://.

The url of your sitemap.xml generated will be: https://your-domain.com/sitemap.xml