SEO/GEO tools and project requests: site index, IndexNow, page JSON-LD, fixes

GEO / SEO
- collectSiteIndex: one list of public docs per locale (pages + archive
  entries) on sitemap rules; llms.txt/llms-full and MCP list_pages now include
  blog/content entries and every language. Fixes hard-coded "## Strony" heading
  and homepage not collapsing to the locale root in llms.txt.
- Markdown frontmatter: canonical url + updated date.
- Metadata: X/Twitter card, OG image width/height/alt, og:type article with
  published/modified times for entries.
- Fix: Site Settings "defaultShareImage" was never used — now the OG fallback.
- getPageJsonLd (createContentHelpers): WebPage/CollectionPage/BlogPosting,
  BreadcrumbList from the real route, FAQPage via a project mapper.
- IndexNow (opt-in ipalKit({ indexNow: true })): submit published URLs in all
  languages, key generated in Site Integrations or INDEXNOW_KEY, key route.
- sameAs profiles in Site Settings + sameAsUrls(); sitemap <image:image>.

From project reports
- Fix: package exports were missing ./env and ./fluid.css although the docs
  import them (TS2307); regression test checks every documented subpath.
- Fix: plugins run before Payload adds its default users collection, so roles
  and 2FA had nothing to attach to — ipalKit injects an auth collection when
  the project has none (project's own one wins). Audit no longer errors on it.
- createMarkdownRoute, createSubmitAction (/server, headers injected).
- formatOpeningHours (PL/EN/DE text → schema.org), used by
  buildLocalBusinessJsonLd, which also takes a schema.org `type`.
- buildNavigationJsonLd straight from the header global.
- buildCsp googleMaps: full Maps JS API domain set; values de-duplicated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-16 02:19:08 +02:00
co-authored by Claude Opus 5.5
parent 9e40d74bb3
commit c9a50abc33
39 changed files with 1449 additions and 168 deletions
+43
View File
@@ -159,3 +159,46 @@ describe('consent cookie', () => {
expect(parseConsent(undefined)).toBeNull()
})
})
describe('buildNavigationJsonLd', () => {
test('resolves page links per locale, keeps own-site links only, dedupes, walks submenus', async () => {
const { buildNavigationJsonLd } = await import('../src/modules/seo/buildSiteNavigationJsonLd.js')
const page = (slug: string) => ({ type: 'internal' as const, page: { slug } })
const nav = buildNavigationJsonLd({
baseUrl: 'https://acme.pl/',
config,
homeSlug: { en: 'home', pl: 'start' },
items: [
{ link: { ...page('start'), label: 'Start' } },
{ link: { ...page('uslugi'), label: 'Usługi' }, subItems: [{ link: { ...page('audyt'), label: 'Audyt' } }] },
{ link: { type: 'external', label: 'Blog firmy X', url: 'https://medium.com/x' } },
{ link: { ...page('uslugi'), label: 'Usługi (dup)' } },
{ link: { ...page('bez-etykiety') } },
],
locale: 'pl',
})
expect(nav?.itemListElement.map((i: { name: string; url: string }) => [i.name, i.url])).toEqual([
['Start', 'https://acme.pl/pl'],
['Usługi', 'https://acme.pl/pl/uslugi'],
['Audyt', 'https://acme.pl/pl/audyt'],
])
})
})
describe('buildCsp — googleMaps', () => {
test('covers Maps JS API domains in every needed directive, no duplicates', () => {
const { value } = buildCsp({ googleMaps: true })
const dir = (name: string) => value.split('; ').find((d) => d.startsWith(`${name} `)) ?? ''
for (const d of ['script-src', 'img-src', 'connect-src']) {
expect(dir(d)).toContain('https://*.googleapis.com')
expect(dir(d)).toContain('https://*.gstatic.com')
}
expect(dir('frame-src')).toContain('https://*.google.com')
expect(dir('worker-src')).toContain('blob:')
for (const d of value.split('; ')) {
const parts = d.split(' ').slice(1)
expect(new Set(parts).size).toBe(parts.length)
}
expect(buildCsp().value).toContain('https://fonts.gstatic.com')
})
})