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.
Why do you I need a sitemap? Search engines can crawl your site without a sitemap by following links, but a sitemap makes it easier for them to discover all your pages, ensuring better and faster indexing.
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:
Location | Priority Level |
---|---|
Landing Page | 1 (Highest Priority) |
Supporting Pages | 0.8 (High Priority) |
Docs | 0.8 (High Priority) |
Blog posts | 0.6 (Medium Priority) |
If you remove the docs feature, increase the blog priority from 0.6
to
0.8
.
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.