Skip to content

Commit ebaf6b0

Browse files
committed
feat: add sitemap and robots.txt for SEO optimization
- Introduced next-sitemap configuration for automatic sitemap generation. - Created robots.txt to manage web crawler access. - Added initial sitemap-0.xml and sitemap.xml files for structured URL indexing.
1 parent e11d2a5 commit ebaf6b0

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

next-sitemap.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/** @type {import('next-sitemap').IConfig} */
2+
module.exports = {
3+
siteUrl: process.env.SITE_URL || 'http://localhost:3000',
4+
exclude: ['/next.svg', '/vercel.svg', '/favicon.ico'],
5+
generateRobotsTxt: true,
6+
generateIndexSitemap: false,
7+
robotsTxtOptions: {
8+
policies: [
9+
{
10+
userAgent: '*',
11+
allow: '/',
12+
},
13+
],
14+
},
15+
};

public/robots.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# *
2+
User-agent: *
3+
Allow: /
4+
5+
# Host
6+
Host: https://shadcn-timeline.vercel.app
7+
8+
# Sitemaps
9+
Sitemap: https://shadcn-timeline.vercel.app/sitemap.xml

public/sitemap-0.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
3+
<url><loc>https://shadcn-timeline.vercel.app</loc><lastmod>2025-01-03T16:53:05.059Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4+
</urlset>

public/sitemap.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<sitemap><loc>https://shadcn-timeline.vercel.app/sitemap-0.xml</loc></sitemap>
4+
</sitemapindex>

0 commit comments

Comments
 (0)