Skip to content

Commit

Permalink
fdas
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajrekwar committed Dec 20, 2024
1 parent 1e474a0 commit cc769da
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@ import { MetadataRoute } from 'next';
import posts from '@/app/blog/data/posts.json'; // Example JSON data file with dynamic routes

export default function sitemap(): MetadataRoute.Sitemap {
const staticRoutes = [
const staticRoutes: MetadataRoute.Sitemap = [
{
url: 'https://neerajrekwar.github.io',
lastModified: new Date(),
changeFrequency: 'monthly',
changeFrequency: 'yearly', // Typed correctly
priority: 1,
},
{
url: 'https://neerajrekwar.github.io/about',
lastModified: new Date(),
changeFrequency: 'monthly',
changeFrequency: 'monthly', // Typed correctly
priority: 0.8,
},
{
url: 'https://neerajrekwar.github.io/blog',
lastModified: new Date(),
changeFrequency: 'weekly',
changeFrequency: 'weekly', // Typed correctly
priority: 0.5,
},
{
url: 'https://neerajrekwar.github.io/contact',
lastModified: new Date(),
changeFrequency: 'weekly',
changeFrequency: 'weekly', // Typed correctly
priority: 0.5,
},
];

// Generate dynamic routes for blog posts
const dynamicRoutes = posts.map(post => ({
const dynamicRoutes: MetadataRoute.Sitemap = posts.map(post => ({
url: `https://neerajrekwar.github.io/blog/${post.slug}`,
lastModified: post.date ? new Date(post.date) : new Date(),
changeFrequency: 'weekly',
changeFrequency: 'weekly', // Typed correctly
priority: 0.7,
}));

Expand Down

0 comments on commit cc769da

Please sign in to comment.