mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
feat(blog): add sitemap.ts with blog and blog post URLs
- Create sitemap.ts with MetadataRoute.Sitemap for Next.js - Include all static pages with priorities and change frequencies - Include /blog index page (priority 0.8, daily updates) - Dynamically include all published blog post URLs (/blog/[slug]) - Blog posts use publish_date as lastModified The sitemap is referenced by robots.ts at /sitemap.xml MKT-71
This commit is contained in:
parent
fe1bfc1fde
commit
994b2ac6e9
1 changed files with 120 additions and 0 deletions
120
apps/web-roo-code/src/app/sitemap.ts
Normal file
120
apps/web-roo-code/src/app/sitemap.ts
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
import type { MetadataRoute } from "next"
|
||||
import { SEO } from "@/lib/seo"
|
||||
import { getAllBlogPosts } from "@/lib/blog"
|
||||
|
||||
/**
|
||||
* Generate sitemap for the website
|
||||
* Includes all static pages and dynamically generated blog post URLs
|
||||
*
|
||||
* @see https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap
|
||||
*/
|
||||
export default function sitemap(): MetadataRoute.Sitemap {
|
||||
const baseUrl = SEO.url
|
||||
|
||||
// Static pages with their last modified dates and priorities
|
||||
const staticPages: MetadataRoute.Sitemap = [
|
||||
{
|
||||
url: baseUrl,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "daily",
|
||||
priority: 1,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/pricing`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "weekly",
|
||||
priority: 0.9,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/extension`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "weekly",
|
||||
priority: 0.8,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/cloud`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "weekly",
|
||||
priority: 0.8,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/slack`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "weekly",
|
||||
priority: 0.7,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/provider`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "weekly",
|
||||
priority: 0.7,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/enterprise`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "monthly",
|
||||
priority: 0.7,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/evals`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "weekly",
|
||||
priority: 0.6,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/reviewer`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "weekly",
|
||||
priority: 0.6,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/pr-fixer`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "weekly",
|
||||
priority: 0.6,
|
||||
},
|
||||
// Blog index page
|
||||
{
|
||||
url: `${baseUrl}/blog`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "daily",
|
||||
priority: 0.8,
|
||||
},
|
||||
// Legal pages
|
||||
{
|
||||
url: `${baseUrl}/terms`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "monthly",
|
||||
priority: 0.3,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/privacy`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "monthly",
|
||||
priority: 0.3,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/legal/cookies`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "monthly",
|
||||
priority: 0.2,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/legal/subprocessors`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "monthly",
|
||||
priority: 0.2,
|
||||
},
|
||||
]
|
||||
|
||||
// Get all published blog posts and generate URLs
|
||||
const blogPosts = getAllBlogPosts()
|
||||
const blogPages: MetadataRoute.Sitemap = blogPosts.map((post) => ({
|
||||
url: `${baseUrl}/blog/${post.slug}`,
|
||||
lastModified: new Date(post.publish_date),
|
||||
changeFrequency: "monthly" as const,
|
||||
priority: 0.7,
|
||||
}))
|
||||
|
||||
return [...staticPages, ...blogPages]
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue