wealth/docs/decisions/0055-static-metadata-except...

19 lines
1.4 KiB
Markdown

# 0055 Static `metadata` everywhere but the channel and post pages
Status: Accepted · Area: architecture · Date: 2026-10-09 · Decided by: user
## Context
Adapted from kasra-pay's decision 0036. Under blocking metadata (0054), any data a `generateMetadata` awaits delays the page's first byte. Almost every Lumina route's title and description is fixed copy from i18next. The channel (`/@username`) and post (`/@username/posts/[id]`) pages are the exception: search results and shared-link previews need the channel's and post's name, image and noindex state.
## Decision
- Every layout and page exports a static `metadata` object, translated with the app's `i18n` when its module loads. A module whose metadata reads a server-only namespace (`landing`, `terms`) imports the server bootstrap first.
- Only the channel and post pages keep `generateMetadata`, reading through the same per-request cache as the page, so the metadata costs no second request.
## Alternatives
- Static everywhere, as kasra-pay: the fastest first byte, but channels and posts lose their titles and images in search and link previews.
- `generateMetadata` everywhere it is convenient: every such page holds back its first byte under 0054.
## Consequences
- On the channel and post pages the skeleton waits for the channel or post read.
- A new page whose metadata must name its data needs this decision amended.