GSC seo
This commit is contained in:
@@ -34,14 +34,20 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
// All blog posts
|
||||
// Filter out future posts so Google doesn't see them
|
||||
const blogPages = blogPosts
|
||||
.filter(post => {
|
||||
const publishDate = post.datePublished ? new Date(post.datePublished) : new Date(post.date);
|
||||
.filter((post) => {
|
||||
const publishDate = post.datePublished
|
||||
? new Date(post.datePublished)
|
||||
: new Date(post.date);
|
||||
return publishDate <= new Date();
|
||||
})
|
||||
.map((post) => ({
|
||||
url: `${baseUrl}/blog/${post.slug}`,
|
||||
// Use updatedAt if available, otherwise dateModified or datePublished
|
||||
lastModified: post.updatedAt ? new Date(post.updatedAt) : (post.dateModified ? new Date(post.dateModified) : new Date()),
|
||||
lastModified: post.updatedAt
|
||||
? new Date(post.updatedAt)
|
||||
: post.dateModified
|
||||
? new Date(post.dateModified)
|
||||
: new Date(),
|
||||
changeFrequency: 'monthly' as const,
|
||||
priority: 0.8,
|
||||
}));
|
||||
@@ -51,7 +57,7 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
};
|
||||
|
||||
const toolLastModified: Record<string, Date> = {
|
||||
'barcode-generator': new Date('2026-04-27'),
|
||||
'barcode-generator': new Date('2026-05-10'),
|
||||
'vcard-qr-code': new Date('2026-04-27'),
|
||||
'instagram-qr-code': new Date('2026-04-27'),
|
||||
'wifi-qr-code': new Date('2026-04-27'),
|
||||
@@ -60,7 +66,8 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
const toolPages = freeTools.map((slug) => ({
|
||||
url: `${baseUrl}/tools/${slug}`,
|
||||
lastModified: toolLastModified[slug] ?? new Date('2026-01-01'),
|
||||
changeFrequency: slug === 'barcode-generator' ? 'weekly' as const : 'monthly' as const,
|
||||
changeFrequency:
|
||||
slug === 'barcode-generator' ? ('weekly' as const) : ('monthly' as const),
|
||||
priority: highPriorityTools[slug] ?? 0.8,
|
||||
}));
|
||||
|
||||
@@ -197,7 +204,7 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/qr-code-tracking`,
|
||||
lastModified: new Date(),
|
||||
lastModified: new Date('2026-05-10'),
|
||||
changeFrequency: 'monthly',
|
||||
priority: 0.9,
|
||||
},
|
||||
@@ -215,7 +222,7 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/dynamic-qr-code-generator`,
|
||||
lastModified: new Date('2026-04-27'),
|
||||
lastModified: new Date('2026-05-10'),
|
||||
changeFrequency: 'weekly',
|
||||
priority: 0.95,
|
||||
},
|
||||
@@ -300,7 +307,6 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
priority: 0.7,
|
||||
},
|
||||
|
||||
|
||||
...toolPages,
|
||||
...blogPages,
|
||||
...learnPages,
|
||||
|
||||
Reference in New Issue
Block a user