Implements essential blog features: 1. RSS Feed (/feed.xml) - Latest 20 posts with full content - Proper XML escaping and CDATA sections - Includes tags, authors, and descriptions - Auto-discovery link in HTML head 2. Sitemap (/sitemap.xml) - All posts, pages, and tag pages - Proper lastModified dates and priorities - Automatic generation via Next.js built-in support 3. Robots.txt (/robots.txt) - Allow all crawlers - Disallow API and admin routes - Links to sitemap for better SEO 4. Code Syntax Highlighting - Using rehype-pretty-code + Shiki - GitHub Dark/Light themes based on user preference - Line numbers for all code blocks - Support for highlighted lines - Inline code styling - Code title support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
15 lines
342 B
TypeScript
15 lines
342 B
TypeScript
import { MetadataRoute } from 'next';
|
|
|
|
export default function robots(): MetadataRoute.Robots {
|
|
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000';
|
|
|
|
return {
|
|
rules: {
|
|
userAgent: '*',
|
|
allow: '/',
|
|
disallow: ['/api/', '/_next/', '/admin/'],
|
|
},
|
|
sitemap: `${siteUrl}/sitemap.xml`,
|
|
};
|
|
}
|