Compare commits

..
Author SHA1 Message Date
sagifer a4df094191 Merge pull request 'Sitemap for the public pages, linked from robots.txt' (#27) from main into prod
CI / test (push) Successful in 1m18s
CI / build (push) Successful in 21s
CI / deploy (push) Successful in 37s
Reviewed-on: #27
2026-11-20 03:15:22 +01:00
fecoandClaude Opus 5.5 55101f8637 Sitemap for the public pages, linked from robots.txt
CI / test (push) Successful in 1m22s
CI / build (push) Successful in 4m53s
CI / deploy (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
2026-11-20 02:11:26 +00:00
2 changed files with 19 additions and 1 deletions
+4 -1
View File
@@ -1,5 +1,7 @@
import type { MetadataRoute } from "next";
import { siteUrl } from "@/lib/share";
// AI crawlers that train models or answer from the site: they load pages
// far more often than visitors do. Link preview robots (Facebook, Messenger,
// Slack, WhatsApp, X, LinkedIn) stay allowed, they make the shared links work.
@@ -38,8 +40,9 @@ const AI_CRAWLERS = [
"Scrapy",
];
export default function robots(): MetadataRoute.Robots {
export default async function robots(): Promise<MetadataRoute.Robots> {
return {
sitemap: `${await siteUrl()}/sitemap.xml`,
rules: [
{ userAgent: AI_CRAWLERS, disallow: "/" },
// Logged-in pages redirect anyway; shared links carry noindex.
+15
View File
@@ -0,0 +1,15 @@
import type { MetadataRoute } from "next";
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` } };
return [
{ url: `${base}/`, changeFrequency: "weekly", priority: 1 },
{ url: `${base}/pelda`, changeFrequency: "monthly", priority: 0.8 },
{ url: `${base}/adatvedelem`, changeFrequency: "yearly", priority: 0.2, alternates: privacy },
{ url: `${base}/privacy`, changeFrequency: "yearly", priority: 0.2, alternates: privacy },
];
}