Skip to content

Commit

Permalink
docs: sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
kyechan99 committed Oct 12, 2024
1 parent 2c7928a commit b9faaca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/www/contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down
6 changes: 6 additions & 0 deletions apps/www/src/app/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Layout } from '@/components/layout';
import { allPosts } from '@/constants/posts';

export default function Home() {
return <Layout>{JSON.stringify(allPosts)}</Layout>;
}
4 changes: 2 additions & 2 deletions apps/www/src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}));
Expand Down

0 comments on commit b9faaca

Please sign in to comment.