diff options
| author | Kha Nguyen <hi@khanguyen.com> | 2025-07-23 17:10:15 -0500 |
|---|---|---|
| committer | Kha Nguyen <hi@khanguyen.com> | 2025-07-23 17:10:15 -0500 |
| commit | 1504b4f60cd53bb37341d492ac6071f91eafdf4f (patch) | |
| tree | d4b3032b94bbe6203e6370b0ca3ee177c1347480 /apps/web/src/app/sitemap.ts | |
| parent | 7bd952b080e2bbba47a063b681d0a668b20ae8cb (diff) | |
| parent | 81ad5c1782bfed92c2fdcd78b5131748871f098e (diff) | |
| download | opencut-1504b4f60cd53bb37341d492ac6071f91eafdf4f.tar.gz | |
Merge branch 'main' into fix/project-title-styling
Diffstat (limited to 'apps/web/src/app/sitemap.ts')
| -rw-r--r-- | apps/web/src/app/sitemap.ts | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/apps/web/src/app/sitemap.ts b/apps/web/src/app/sitemap.ts new file mode 100644 index 00000000..81a5ebf4 --- /dev/null +++ b/apps/web/src/app/sitemap.ts @@ -0,0 +1,61 @@ +import { SITE_URL } from "@/constants/site"; +import { getPosts } from "@/lib/blog-query"; +import type { MetadataRoute } from "next"; + +export default async function sitemap(): Promise<MetadataRoute.Sitemap> { + const data = await getPosts(); + + const postPages: MetadataRoute.Sitemap = + data?.posts?.map((post) => ({ + url: `${SITE_URL}/blog/${post.slug}`, + lastModified: new Date(post.publishedAt), + changeFrequency: "weekly", + priority: 0.8, + })) ?? []; + + return [ + { + url: SITE_URL, + lastModified: new Date(), + changeFrequency: "weekly", + priority: 1, + }, + { + url: `${SITE_URL}/contributors`, + lastModified: new Date(), + changeFrequency: "daily", + priority: 0.5, + }, + { + url: `${SITE_URL}/roadmap`, + lastModified: new Date(), + changeFrequency: "weekly", + priority: 1, + }, + { + url: `${SITE_URL}/privacy`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.5, + }, + { + url: `${SITE_URL}/terms`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.5, + }, + { + url: `${SITE_URL}/why-not-capcut`, + lastModified: new Date(), + changeFrequency: "yearly", + priority: 1, + }, + { + url: `${SITE_URL}/blog`, + lastModified: new Date(), + changeFrequency: "weekly", + priority: 1, + }, + ...postPages, + ]; +} |
