Skip to content

Commit

Permalink
feat: robots.txt, sitemap.xml generator draft
Browse files Browse the repository at this point in the history
  • Loading branch information
youngminss committed Feb 21, 2025
1 parent b17acbc commit 2d33784
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/robots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { MetadataRoute } from 'next';

export default function robots(): MetadataRoute.Robots {
return {
rules: [
{
userAgent: '*',
allow: '/',
},
],
sitemap: 'https://www.for-the-block.com/sitemap.xml',
};
}
43 changes: 43 additions & 0 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import type { MetadataRoute } from 'next';

const BASE_URL = 'https://www.for-the-block.com';
const DEFAULT_LAST_MOD = '2025-02-21';

const staticPaths: MetadataRoute.Sitemap = [
{
url: `${BASE_URL}`,
lastModified: DEFAULT_LAST_MOD,
changeFrequency: 'monthly',
priority: 1,
},
{
url: `${BASE_URL}/quiz`,
lastModified: DEFAULT_LAST_MOD,
changeFrequency: 'monthly',
priority: 1,
},
];

export default function sitemap(): MetadataRoute.Sitemap {
return [
...staticPaths,
{
url: `${BASE_URL}/information`,
lastModified: new Date(),
changeFrequency: 'daily',
priority: 1,
},
{
url: `${BASE_URL}/chat`,
lastModified: new Date(),
changeFrequency: 'weekly',
priority: 0.8,
},
{
url: `${BASE_URL}/poll`,
lastModified: new Date(),
changeFrequency: 'daily',
priority: 0.8,
},
];
}

0 comments on commit 2d33784

Please sign in to comment.