03c10eab6e
- SeriesGrid: карточки серий с иконками (Sparkles/Plug/Zap/Layers) и цветовыми темами - /series/[slug]: страница серии с интро и сеткой статей в порядке из article_ids - Stats: count-up анимация (easeOutQuart 1.2s) при появлении в viewport через IntersectionObserver - sitemap.xml: добавлены /notes и все серии
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
import { listArticles, listTags, listSeries } from '@/lib/engine';
|
|
|
|
const SITE = 'https://zeropost.ru';
|
|
|
|
export default async function sitemap() {
|
|
const [articles, tags, series] = await Promise.all([
|
|
listArticles({ limit: 200 }).catch(() => []),
|
|
listTags().catch(() => []),
|
|
listSeries().catch(() => []),
|
|
]);
|
|
|
|
const staticPages = [
|
|
{ url: `${SITE}/`, lastModified: new Date(), changeFrequency: 'daily', priority: 1 },
|
|
{ url: `${SITE}/about`, lastModified: new Date(), changeFrequency: 'monthly', priority: 0.5 },
|
|
{ url: `${SITE}/notes`, lastModified: new Date(), changeFrequency: 'daily', priority: 0.6 },
|
|
];
|
|
|
|
const articlePages = articles.map(a => ({
|
|
url: `${SITE}/blog/${a.slug}`,
|
|
lastModified: a.published_at ? new Date(a.published_at) : new Date(),
|
|
changeFrequency: 'monthly',
|
|
priority: 0.8,
|
|
}));
|
|
|
|
const tagPages = tags.map(t => ({
|
|
url: `${SITE}/tag/${encodeURIComponent(t.tag)}`,
|
|
lastModified: new Date(),
|
|
changeFrequency: 'weekly',
|
|
priority: 0.6,
|
|
}));
|
|
|
|
const seriesPages = series.map(s => ({
|
|
url: `${SITE}/series/${s.slug}`,
|
|
lastModified: s.updated_at ? new Date(s.updated_at) : new Date(),
|
|
changeFrequency: 'weekly',
|
|
priority: 0.7,
|
|
}));
|
|
|
|
return [...staticPages, ...articlePages, ...seriesPages, ...tagPages];
|
|
}
|