Give /privacy and /terms the marketing page header - #2593
Conversation
Both pages rendered as bare prose with no header, unlike every other marketing page. The pink hero and yellow marquee come from the MDX <Hero> component, which help articles and the five card-* legal pages get because their content markdown includes a <Hero /> tag. privacy and terms never had one. The header goes in the page components rather than the markdown: legal content is content_mode: verbatim, authored upstream in peanutprotocol/mono, and content/legal/README.md is explicit that generation must not overwrite those files — anything written into the mirror would be reverted on the next sync. Title comes from frontmatter (with the "| Peanut" suffix already stripped by displayTitle), so it picks up legal translations automatically if they ever ship and falls back to English until then. The subtitle is a catalog string, translated for all three locales.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
…o feat/legal-pages-header
…Hero privacy/terms markdown is authored upstream with its own '# Title' — the mirror is read-only, so rendering <Hero title> above it produced the same string in two h1s. Strip only the FIRST node when it's an h1 (the bodies use '##' for sections; a blanket strip would swallow authoring signals), opt-in via renderContent's new stripLeadingH1 option, enabled on the two pages that carry a Hero over verbatim content. The card-* legal pages already follow the Hero-instead-of-h1 convention and are untouched. Also merges the updated base (es-AR restore) and adds the two legal Hero subtitle keys to the restored es-ar catalog (voseo).
|
Pushed Also merged the updated base ( Verified in the browser: exactly one h1 on /en/privacy, /en/terms and /es-419/privacy. Reminder for merge: this PR is stacked — after #2592 lands, retarget the base to dev in the UI (no force-push needed). |
Stacked on #2592 — review that one first; this branch targets it, so the diff here is just the two page components plus two catalog strings.
Problem
/en/privacyand/en/termsrender as bare prose with no header, unlike every other marketing page.The pink hero and yellow marquee come from the MDX
<Hero>component. Help articles get it because their content markdown contains a<Hero title="…" />tag, and so do the five card-* legal pages (card-esign,card-privacy,card-terms-us,card-terms-international,card-prohibited-activities). Onlyprivacyandtermsnever had one.Why the fix is in the page component, not the content
Legal markdown is
content_mode: verbatimand authored upstream inpeanutprotocol/mono.content/legal/README.mdis explicit that content generation must never overwrite those files, andpeanut-ui/src/contentis a read-only mirror — anything written there is reverted by the next mirror run.Rendering
<Hero>fromprivacy/page.tsxandterms/page.tsxsidesteps that entirely and applies to every locale without touching legal text.Localization
mdxSource.frontmatter.title, with the| Peanutsuffix already stripped by the existingdisplayTitle. Legal is English-only today (translations are gated on legal review), so it renders English via the fallback chain — and picks up translations automatically if they ever ship, with no further code change.Screenshot
Verification
tsc --noEmitclean,prettier --check .clean, production build green. Hero confirmed rendering on/en/privacy,/en/terms,/es-419/privacyand/pt-br/terms.Note: stacked PRs in this repo don't always trigger the full CI matrix, since some workflows only fire for
main/dev-based PRs. If checks look sparse here they should be kicked manually rather than read as green.