mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
* Thinking v0 * Change * Fix * improvement(ui/ux): mothership chat experience * user input animation * improvement(landing): desktop complete * auth and 404 * mobile friendliness and home templates * improvement(home): templates * fix: feature flags * address comments --------- Co-authored-by: Emir Karabeg <emirkarabeg@berkeley.edu>
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import type { MetadataRoute } from 'next'
|
|
import { getAllPostMeta } from '@/lib/blog/registry'
|
|
import { getBaseUrl } from '@/lib/core/utils/urls'
|
|
|
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
const baseUrl = getBaseUrl()
|
|
|
|
const now = new Date()
|
|
|
|
const staticPages: MetadataRoute.Sitemap = [
|
|
{
|
|
url: baseUrl,
|
|
lastModified: now,
|
|
},
|
|
{
|
|
url: `${baseUrl}/blog`,
|
|
lastModified: now,
|
|
},
|
|
{
|
|
url: `${baseUrl}/blog/tags`,
|
|
lastModified: now,
|
|
},
|
|
{
|
|
url: `${baseUrl}/templates`,
|
|
lastModified: now,
|
|
},
|
|
{
|
|
url: `${baseUrl}/changelog`,
|
|
lastModified: now,
|
|
},
|
|
{
|
|
url: `${baseUrl}/terms`,
|
|
lastModified: new Date('2024-10-14'),
|
|
},
|
|
{
|
|
url: `${baseUrl}/privacy`,
|
|
lastModified: new Date('2024-10-14'),
|
|
},
|
|
]
|
|
|
|
const posts = await getAllPostMeta()
|
|
const blogPages: MetadataRoute.Sitemap = posts.map((p) => ({
|
|
url: p.canonical,
|
|
lastModified: new Date(p.updated ?? p.date),
|
|
}))
|
|
|
|
return [...staticPages, ...blogPages]
|
|
}
|