feat(docs-site): read footer from the per-tenant CMS collection
apple / swift (push) Successful in 55s
ci / rust (push) Successful in 1m38s
ci / web (push) Successful in 32s
ci / docs-site (push) Successful in 35s
android / android (push) Successful in 3m40s
deb / build-publish (push) Successful in 3m9s
decky / build-publish (push) Successful in 14s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 5s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 5s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 3s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 4s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 21s
ci / bench (push) Successful in 4m47s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Successful in 8m22s
docker / deploy-docs (push) Successful in 18s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Successful in 8m59s
apple / swift (push) Successful in 55s
ci / rust (push) Successful in 1m38s
ci / web (push) Successful in 32s
ci / docs-site (push) Successful in 35s
android / android (push) Successful in 3m40s
deb / build-publish (push) Successful in 3m9s
decky / build-publish (push) Successful in 14s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 5s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 5s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 3s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 4s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 21s
ci / bench (push) Successful in 4m47s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Successful in 8m22s
docker / deploy-docs (push) Successful in 18s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Successful in 8m59s
The shared unom CMS is now multi-tenant; the footer global became a per-tenant collection. Query footers scoped to tenant.slug = punktfunk instead of the removed /globals/footer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,12 @@
|
|||||||
// The docs reuse the punktfunk marketing site's footer — the same Payload CMS
|
// The docs reuse the punktfunk footer from the shared unom CMS (cms.unom.io).
|
||||||
// global on the shared unom CMS (cms.unom.io). It's a read-only GET, so a plain
|
// The CMS is multi-tenant: footer is a per-tenant collection, so scope the read
|
||||||
// typed fetch rather than pulling in the Payload SDK + generated types.
|
// to this project's tenant. Read-only GET, so a plain typed fetch rather than
|
||||||
|
// pulling in the Payload SDK + generated types.
|
||||||
const CMS_URL = 'https://cms.unom.io'
|
const CMS_URL = 'https://cms.unom.io'
|
||||||
|
|
||||||
|
// This project's tenant in the shared CMS.
|
||||||
|
const TENANT = 'punktfunk'
|
||||||
|
|
||||||
export interface NavigationLink {
|
export interface NavigationLink {
|
||||||
id?: string | null
|
id?: string | null
|
||||||
label?: string | null
|
label?: string | null
|
||||||
@@ -20,8 +24,10 @@ export interface Footer {
|
|||||||
sections?: NavigationSection[] | null
|
sections?: NavigationSection[] | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function findFooter(): Promise<Footer> {
|
export async function findFooter(): Promise<Footer | null> {
|
||||||
const res = await fetch(`${CMS_URL}/api/globals/footer?locale=en&depth=1`)
|
const query = `where%5Btenant.slug%5D%5Bequals%5D=${TENANT}&locale=en&depth=1&limit=1`
|
||||||
|
const res = await fetch(`${CMS_URL}/api/footers?${query}`)
|
||||||
if (!res.ok) throw new Error(`CMS footer request failed: ${res.status}`)
|
if (!res.ok) throw new Error(`CMS footer request failed: ${res.status}`)
|
||||||
return res.json() as Promise<Footer>
|
const data = (await res.json()) as { docs?: Footer[] }
|
||||||
|
return data.docs?.[0] ?? null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user