Docs
SEO

Sitemap

Learn more about the sitemap in the starter kit.

A sitemap is a file that contains a list of all the pages within your application. It's a tool for SEO, as it enables search engines to better understand your app and its structure.

Structure

The sitemap is an XML structure of URLS:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://localhost:300/</loc>
    <lastmod>2025-01-24T18:50:24.664Z</lastmod>
    <priority>1</priority>
  </url>
</urlset>

In Typescript we could describe it like:

type Sitemap = Entry[];
type Entry = {
    location: string;
    lastmod: Date;
    priority?: number;
};

Dashboard

The dashboard isn't relevant for search engines. We just return the base URL.

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://localhost:300/</loc>
    <lastmod>2025-01-24T18:50:24.664Z</lastmod>
    <priority>1</priority>
  </url>
</urlset>

Marketing

Lets have a look at the marketing sitemap output:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<url>
		<loc>http://localhost:3001/</loc>
		<lastmod>2025-01-24T18:50:24.664Z</lastmod>
		<priority>1</priority>
	</url>
	<url>
		<loc>http://localhost:3001/blog</loc>
		<lastmod>2025-01-24T18:32:11.921Z</lastmod>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://localhost:3001/blog/a-founders-roadmap-to-digital-innovation</loc>
		<lastmod>2024-11-25T12:00:00.000Z</lastmod>
		<priority>0.6</priority>
	</url>
	<url>
		<loc>http://localhost:3001/blog/the-role-of-ai-in-revolutionizing-crm-systems</loc>
		<lastmod>2024-11-24T12:00:00.000Z</lastmod>
		<priority>0.6</priority>
	</url>
	<url>
		<loc>http://localhost:3001/careers</loc>
		<lastmod>2025-01-24T18:32:15.333Z</lastmod>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://localhost:3001/contact</loc>
		<lastmod>2025-01-24T18:32:02.857Z</lastmod>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://localhost:3001/cookie-policy</loc>
		<lastmod>2025-01-24T18:32:06.909Z</lastmod>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://localhost:3001/docs</loc>
		<lastmod>2025-01-24T18:50:24.664Z</lastmod>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://localhost:3001/docs/dependencies</loc>
		<lastmod>2025-01-24T18:50:24.664Z</lastmod>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://localhost:3001/docs/using-mdx</loc>
		<lastmod>2025-01-24T18:50:24.664Z</lastmod>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://localhost:3001/pricing</loc>
		<lastmod>2025-01-24T18:32:15.925Z</lastmod>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://localhost:3001/privacy-policy</loc>
		<lastmod>2025-01-24T18:32:07.581Z</lastmod>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://localhost:3001/story</loc>
		<lastmod>2025-01-24T18:32:19.377Z</lastmod>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://localhost:3001/terms-of-use</loc>
		<lastmod>2025-01-24T18:31:59.565Z</lastmod>
		<priority>0.8</priority>
	</url>
</urlset>

We set following priorities:

LocationPriority Level
Landing Page1 (Highest Priority)
Supporting Pages0.8 (High Priority)
Docs0.8 (High Priority)
Blog posts0.6 (Medium Priority)

Updating the sitemap

The sitemap generator will update the URLs, including the lastmod date, automatically. It traverses the app tree, normalizes the Next.js app relevant files and uses the individual filestat data.

You can find the file at apps/marketing/app/sitemap/route.ts and change some details about it.