Skip to content

Commit

Permalink
feat: add sitemap and robots.txt for SEO optimization
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
timDeHof committed Jan 3, 2025
1 parent e11d2a5 commit ebaf6b0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
15 changes: 15 additions & 0 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.SITE_URL || 'http://localhost:3000',
exclude: ['/next.svg', '/vercel.svg', '/favicon.ico'],
generateRobotsTxt: true,
generateIndexSitemap: false,
robotsTxtOptions: {
policies: [
{
userAgent: '*',
allow: '/',
},
],
},
};
9 changes: 9 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# *
User-agent: *
Allow: /

# Host
Host: https://shadcn-timeline.vercel.app

# Sitemaps
Sitemap: https://shadcn-timeline.vercel.app/sitemap.xml
4 changes: 4 additions & 0 deletions public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<url><loc>https://shadcn-timeline.vercel.app</loc><lastmod>2025-01-03T16:53:05.059Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>
4 changes: 4 additions & 0 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://shadcn-timeline.vercel.app/sitemap-0.xml</loc></sitemap>
</sitemapindex>

0 comments on commit ebaf6b0

Please sign in to comment.