Multi-page public site (Next.js), Node/Express backend with Postgres, and Vite admin/account app, restructured from a single-page layout into dedicated service, promotions, cases, about, FAQ, and blog pages for SEO. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013otXCiTZsxdZ4SJKZ9wUky
31 lines
1.3 KiB
JavaScript
31 lines
1.3 KiB
JavaScript
import { serverApi } from '../lib/serverApi.js';
|
|
|
|
const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL || 'https://top-sysops.ru';
|
|
|
|
export default async function sitemap() {
|
|
const [posts, services] = await Promise.all([serverApi.getBlogPosts(), serverApi.getServices()]);
|
|
|
|
return [
|
|
{ url: `${SITE_URL}/`, changeFrequency: 'weekly', priority: 1.0 },
|
|
{ url: `${SITE_URL}/uslugi`, changeFrequency: 'weekly', priority: 0.9 },
|
|
...services.map((cat) => ({
|
|
url: `${SITE_URL}/uslugi/${cat.slug}`,
|
|
changeFrequency: 'monthly',
|
|
priority: 0.8,
|
|
})),
|
|
{ url: `${SITE_URL}/aktsii`, changeFrequency: 'weekly', priority: 0.7 },
|
|
{ url: `${SITE_URL}/keysy`, changeFrequency: 'monthly', priority: 0.6 },
|
|
{ url: `${SITE_URL}/o-kompanii`, changeFrequency: 'monthly', priority: 0.6 },
|
|
{ url: `${SITE_URL}/otzyvy`, changeFrequency: 'weekly', priority: 0.5 },
|
|
{ url: `${SITE_URL}/faq`, changeFrequency: 'monthly', priority: 0.5 },
|
|
{ url: `${SITE_URL}/kontakty`, changeFrequency: 'monthly', priority: 0.6 },
|
|
{ url: `${SITE_URL}/blog`, changeFrequency: 'weekly', priority: 0.7 },
|
|
...posts.map((p) => ({
|
|
url: `${SITE_URL}/blog/${p.slug}`,
|
|
lastModified: p.published_at ? new Date(p.published_at) : undefined,
|
|
changeFrequency: 'monthly',
|
|
priority: 0.6,
|
|
})),
|
|
];
|
|
}
|