From b9faacaf80cc503950b47f9acf2c40d22188fff9 Mon Sep 17 00:00:00 2001 From: kyechan99 Date: Sat, 12 Oct 2024 18:23:36 +0900 Subject: [PATCH] docs: sitemap --- apps/www/contentlayer.config.ts | 2 +- apps/www/src/app/admin/page.tsx | 6 ++++++ apps/www/src/app/sitemap.ts | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 apps/www/src/app/admin/page.tsx diff --git a/apps/www/contentlayer.config.ts b/apps/www/contentlayer.config.ts index 66bad0a..bf80eba 100644 --- a/apps/www/contentlayer.config.ts +++ b/apps/www/contentlayer.config.ts @@ -43,7 +43,7 @@ export const Post = defineDocumentType(() => ({ }, path: { type: 'string', - resolve: (doc: any) => 'bmates/' + doc._raw.flattenedPath.replace(/^(docs|project)\//, ''), + resolve: (doc: any) => doc._raw.flattenedPath.replace(/^(docs|project)\//, ''), }, postType: { type: 'string', resolve: (doc: any) => doc._raw.sourceFileDir.split('/')[0] }, searchTxt: { type: 'string', resolve: (doc: any) => searchTermOptimization(doc.title) }, diff --git a/apps/www/src/app/admin/page.tsx b/apps/www/src/app/admin/page.tsx new file mode 100644 index 0000000..634387f --- /dev/null +++ b/apps/www/src/app/admin/page.tsx @@ -0,0 +1,6 @@ +import { Layout } from '@/components/layout'; +import { allPosts } from '@/constants/posts'; + +export default function Home() { + return {JSON.stringify(allPosts)}; +} diff --git a/apps/www/src/app/sitemap.ts b/apps/www/src/app/sitemap.ts index 00eeab9..bfe71e7 100644 --- a/apps/www/src/app/sitemap.ts +++ b/apps/www/src/app/sitemap.ts @@ -4,14 +4,14 @@ import { allPosts } from '@/constants/posts'; export default function sitemap(): MetadataRoute.Sitemap { const posts = allPosts.map(post => ({ - url: `https://Bandmators.github.io/${post._raw.flattenedPath}`, + url: `https://Bandmators.github.io/bmates/${post._raw.flattenedPath}`, lastModified: new Date(post.lastUpdatedDate).toISOString().split('T')[0], changeFrequency: 'monthly', priority: 0.7, })); const routes = ['', '/docs'].map(route => ({ - url: `https://Bandmators.github.io${route}`, + url: `https://Bandmators.github.io/bmates${route}`, lastModified: new Date().toISOString().split('T')[0], priority: 0.5, }));