feat(docs-site): add the site-wide footer, shared with the marketing site

Pull the same footer from the shared unom CMS global (cms.unom.io) and render
it globally under both the home and docs layouts. Read-only typed fetch in a
server-side root loader (falls back to null on a CMS hiccup). Root-relative
links target the marketing site, so they're resolved against its origin (the
docs don't host /legal/* etc.); themed with Fumadocs tokens for light/dark.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-20 15:42:39 +02:00
parent 5d0abdd63c
commit 15697467ee
3 changed files with 101 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
// The docs reuse the punktfunk marketing site's footer — the same Payload CMS
// global on the shared unom CMS (cms.unom.io). It's a read-only GET, so a plain
// typed fetch rather than pulling in the Payload SDK + generated types.
const CMS_URL = 'https://cms.unom.io'
export interface NavigationLink {
id?: string | null
label?: string | null
to?: string | null
}
export interface NavigationSection {
id?: string | null
title?: string | null
entries?: NavigationLink[] | null
}
export interface Footer {
tagline?: string | null
sections?: NavigationSection[] | null
}
export async function findFooter(): Promise<Footer> {
const res = await fetch(`${CMS_URL}/api/globals/footer?locale=en&depth=1`)
if (!res.ok) throw new Error(`CMS footer request failed: ${res.status}`)
return res.json() as Promise<Footer>
}