SEO: multilingual homepage (homeSlug per locale in path/sitemap), Article + llms.txt generators, siteDescription fallback, composeTitle dedup
This commit is contained in:
Vendored
+2
-2
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user