Files
sorsfonalak/services/frontend/src/app/sitemap.ts
T
fecoandClaude Opus 5.5 e0605a7653 Public gift pages for visitors and search engines
- /ajandek shows a page about giving to visitors (indexable, in the sitemap);
  the form still needs a login.
- A gift band on the home page and "Ajándékozás" in the footer (to
  /karacsony in the Christmas season).
- A link preview image for /karacsony.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
2026-11-24 16:56:17 +00:00

42 lines
2.2 KiB
TypeScript

import type { MetadataRoute } from "next";
import { ZODIAC } from "@/content/zodiac";
import { loadCelebrities } from "@/lib/celebrities";
import { currentYear } from "@/lib/sky";
import { siteUrl } from "@/lib/share";
/** The public pages for search engines; everything else needs a login. */
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const base = await siteUrl();
const privacy = { languages: { hu: `${base}/adatvedelem`, en: `${base}/privacy` } };
// The sitemap still works when the backend does not answer.
const people = await loadCelebrities().catch(() => []);
const next = currentYear() + 1;
return [
{ url: `${base}/`, changeFrequency: "weekly", priority: 1 },
{ url: `${base}/pelda`, changeFrequency: "monthly", priority: 0.8 },
{ url: `${base}/kartyajoslas/pelda`, changeFrequency: "monthly", priority: 0.7 },
{ url: `${base}/szuletesi-horoszkop`, changeFrequency: "monthly", priority: 0.9 },
{ url: `${base}/csillagjegyek`, changeFrequency: "monthly", priority: 0.8 },
...ZODIAC.map((z) => ({ url: `${base}/csillagjegyek/${z.slug}`, changeFrequency: "monthly" as const, priority: 0.7 })),
{ url: `${base}/holdnaptar`, changeFrequency: "daily", priority: 0.8 },
{ url: `${base}/holdnaptar/${next}`, changeFrequency: "monthly", priority: 0.6 },
{ url: `${base}/retrograd`, changeFrequency: "daily", priority: 0.8 },
{ url: `${base}/retrograd/${next}`, changeFrequency: "monthly", priority: 0.6 },
{ url: `${base}/hires-emberek`, changeFrequency: "weekly", priority: 0.7 },
...people.map((p) => ({
url: `${base}/hires-emberek/${p.slug}`,
lastModified: p.updated_at,
changeFrequency: "monthly" as const,
priority: 0.6,
})),
{ url: `${base}/aszf`, changeFrequency: "yearly", priority: 0.2 },
{ url: `${base}/kapcsolat`, changeFrequency: "yearly", priority: 0.2 },
{ url: `${base}/karacsony`, changeFrequency: "monthly", priority: 0.7 },
{ url: `${base}/ajandek`, changeFrequency: "monthly", priority: 0.6 },
{ url: `${base}/adatvedelem`, changeFrequency: "yearly", priority: 0.2, alternates: privacy },
{ url: `${base}/privacy`, changeFrequency: "yearly", priority: 0.2, alternates: privacy },
];
}