SEO: multilingual homepage (homeSlug per locale in path/sitemap), Article + llms.txt generators, siteDescription fallback, composeTitle dedup

This commit is contained in:
2026-09-15 15:31:08 +02:00
parent 87d575f335
commit 33ae035adc
25 changed files with 398 additions and 61 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import { buildHreflangAlternates } from './hreflang.js';
* Designed for use inside Next.js `generateMetadata`. The caller resolves the
* pieces (meta group, site name, image URL, localized slugs) and passes them
* in — the plugin composes, it doesn't fetch.
*/ export function buildMetadata({ baseUrl, config, homeSlug = 'home', imageUrl, locale, meta, order, pageTitle, prefix, query, separator, siteName, slugs }) {
*/ export function buildMetadata({ baseUrl, config, homeSlug = 'home', imageUrl, locale, meta, order, pageTitle, prefix, query, separator, siteDescription, siteName, slugs }) {
// Title source priority: titleOverride (exact, wins outright) > meta.title
// (SEO title an editor set) > pageTitle (the document's own name). This means
// a page with no SEO title still shows its name (e.g. 'Sprzątanie biur')
@@ -22,7 +22,7 @@ import { buildHreflangAlternates } from './hreflang.js';
separator,
siteName
});
const description = meta?.description?.trim() || undefined;
const description = meta?.description?.trim() || siteDescription?.trim() || undefined;
const origin = baseUrl?.replace(/\/$/, '') ?? '';
const suffix = query ?? '';
const currentPath = buildLocalizedPath({