14 blog post schedule
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { MetadataRoute } from 'next';
|
||||
import { blogPostList } from '../lib/blog-data';
|
||||
import { blogPosts } from '../lib/blog-data';
|
||||
import { pillarMeta } from '../lib/pillar-data';
|
||||
import { authors } from '../lib/author-data';
|
||||
|
||||
export default function sitemap(): MetadataRoute.Sitemap {
|
||||
const baseUrl = 'https://www.qrmaster.net';
|
||||
@@ -29,12 +31,19 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
];
|
||||
|
||||
// All blog posts
|
||||
const blogPages = blogPostList.map((post) => ({
|
||||
url: `${baseUrl}/blog/${post.slug}`,
|
||||
lastModified: post.dateModified ? new Date(post.dateModified) : new Date(),
|
||||
changeFrequency: 'monthly' as const,
|
||||
priority: 0.8,
|
||||
}));
|
||||
// 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);
|
||||
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()),
|
||||
changeFrequency: 'monthly' as const,
|
||||
priority: 0.8,
|
||||
}));
|
||||
|
||||
const toolPages = freeTools.map((slug) => ({
|
||||
url: `${baseUrl}/tools/${slug}`,
|
||||
@@ -43,6 +52,30 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
priority: 0.8,
|
||||
}));
|
||||
|
||||
// Learn hub and pillar pages
|
||||
const learnPages = [
|
||||
{
|
||||
url: `${baseUrl}/learn`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: 'weekly' as const,
|
||||
priority: 0.9,
|
||||
},
|
||||
...pillarMeta.map((pillar) => ({
|
||||
url: `${baseUrl}/learn/${pillar.key}`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: 'monthly' as const,
|
||||
priority: 0.8,
|
||||
})),
|
||||
];
|
||||
|
||||
// Author pages
|
||||
const authorPages = authors.map((author) => ({
|
||||
url: `${baseUrl}/authors/${author.slug}`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: 'monthly' as const,
|
||||
priority: 0.7,
|
||||
}));
|
||||
|
||||
return [
|
||||
{
|
||||
url: baseUrl,
|
||||
@@ -92,12 +125,7 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
changeFrequency: 'weekly',
|
||||
priority: 0.9,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/manage-qr-codes`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: 'weekly',
|
||||
priority: 0.9,
|
||||
},
|
||||
|
||||
{
|
||||
url: `${baseUrl}/pricing`,
|
||||
lastModified: new Date(),
|
||||
@@ -128,18 +156,7 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
changeFrequency: 'weekly',
|
||||
priority: 0.8,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/signup`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: 'monthly',
|
||||
priority: 0.8,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/login`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: 'yearly',
|
||||
priority: 0.5,
|
||||
},
|
||||
|
||||
{
|
||||
url: `${baseUrl}/privacy`,
|
||||
lastModified: new Date(),
|
||||
@@ -158,27 +175,12 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
changeFrequency: 'yearly',
|
||||
priority: 0.6,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/guide/tracking-analytics`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: 'monthly',
|
||||
priority: 0.8,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/guide/bulk-qr-code-generation`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: 'monthly',
|
||||
priority: 0.8,
|
||||
},
|
||||
{
|
||||
url: `${baseUrl}/guide/qr-code-best-practices`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: 'monthly',
|
||||
priority: 0.8,
|
||||
},
|
||||
|
||||
|
||||
...toolPages,
|
||||
...blogPages,
|
||||
...learnPages,
|
||||
...authorPages,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user