feat(layouts): consolidate topic page layouts#18198
feat(layouts): consolidate topic page layouts#18198myelinated-wackerow wants to merge 4 commits into
Conversation
Folds Staking, UseCases, Roadmap, and Upgrade into a single async server TopicLayout. Per-topic config (translation namespace, dropdown items, hero dimensions, edit banner) lives in src/data/topics/. Old layout files become MDX component bundles only and move to src/components/MdComponents/topics/. Consolidates the four per-section Frontmatter interfaces plus SummaryPointsNumbered into TopicFrontmatter, and deletes the now-unused getSummaryPoints helper. Behavior preserved: dropdown items, Matomo events, hero dimensions, edit banner (UseCases topic), Staking community callout (passed as afterContent slot by the slug router). Translatathon untouched; pending its redirect-to-/contributing deletion in a separate PR. See docs/topic-layout-refactor.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Rewrites summaryPoint1..4 frontmatter fields into a single summaryPoints array across 15 EN markdown files plus their on-disk translations (~360 files, 24 locales). Also drops the dead emoji frontmatter field, verified unused in any topic layout or hero component. Possible only because none of the touched paths were ingested by the intl-pipeline yet (.manifests/public/content/ check confirms no entries). The migration is a flat find-replace on EN + translations rather than a pipeline-coordinated change. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Hoists the Codeblock-wrapped Pre handler (previously duplicated inline in Docs and Tutorial layouts) into MdComponents.htmlElements as the site-wide default for fenced code blocks. Topic, Static, and other markdown-content layouts now get syntax highlighting and the copy-to-clipboard widget for free. Drops the duplicate inline definitions from src/layouts/Docs.tsx and src/layouts/Tutorial.tsx. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Adds the canonical-layouts reference and a top-level rule in the design-system skill so future agents reach for a TopicLayout config (src/data/topics/<key>.ts) before creating a new layout component. The default should be "configure, don't add new" for any page that fits the topic-hub-with-sub-nav pattern. - references/layouts.md: full inventory of the six canonical layouts (TopicLayout, StaticLayout, DocsLayout, TutorialLayout, ContentLayout, BaseLayout), worked example for adding a new topic, and the cases where a new layout is actually warranted. - SKILL.md: top rule #11 surfacing the guidance up front, plus a references-table entry pointing to layouts.md. - references/cleanup-playbook.md: "per-section layout -> TopicLayout config" entry with before/after, so agents auditing legacy code know the canonical replacement. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
pettinarip
left a comment
There was a problem hiding this comment.
@myelinated-wackerow great work overall!
| ...props | ||
| }: ContentLayoutProps) => { | ||
| return ( | ||
| <div {...props}> | ||
| {editBanner} |
There was a problem hiding this comment.
this is a parent implementation problem that should live here. This banner or whatever the parent want to render should probable be part of heroSection and keep the API clean. Small issue but leaves an unnecessary prop imo
| "use-cases": TopicLayout, | ||
| staking: TopicLayout, | ||
| roadmap: TopicLayout, | ||
| upgrade: TopicLayout, |
| if (topicConfig) { | ||
| const afterContent = | ||
| layout === "staking" ? ( | ||
| <StakingCommunityCallout className="my-16" /> |
There was a problem hiding this comment.
sidecomment, we should probably need to think about a global callout component (in base layout perhaps) to be used for any page that needs something like this
| config={topicConfig} | ||
| afterContent={afterContent} | ||
| > | ||
| {content} |
There was a problem hiding this comment.
instead of adding a new prop afterContent we could just do
| {content} | |
| {content} | |
| {afterContent} |
| }, | ||
| ], | ||
| }, | ||
| heroImage: { width: 1456, height: 816 }, |
There was a problem hiding this comment.
I'd strip this heroImage data from here. This is a UI related data that the Layout knows better the size of the hero image to be displayed.

Summary
Folds Staking, UseCases, Roadmap, and Upgrade markdown layouts into a single async server
TopicLayoutdriven by per-topic config insrc/data/topics/<key>.ts. Each section becomes a small config file (translation namespace, dropdown items, hero dimensions, edit banner) instead of a near-duplicate layout component. The four old layout files become MDX component bundles only and move tosrc/components/MdComponents/topics/.Companion changes in the same PR:
summaryPoint1..4to a singlesummaryPointsarray; drops the deademojifrontmatter field. Safe to land as a flat find-replace because none of the touched paths are ingested by the intl-pipeline yet (verified via.manifests/public/content/check).Codeblock-wrappedPrehandler -- previously duplicated inline in Docs and Tutorial layouts -- intoMdComponents.htmlElementsas the site-wide default for fenced code blocks.Behavior preservation
Dropdown labels, Matomo event names/categories, hero image dimensions, the edit banner (UseCases topic), and Staking's community callout are preserved verbatim. The community callout is passed as an
afterContentslot prop by the slug router fortemplate: stakingpages.Related
TopicLayoutStorybook story deferred -- server-componentgetTranslationsneeds a request context that the project'sstorybook-next-intlsetup doesn't provide; worth its own discussionTest plan
/staking/,/staking/solo/,/staking/saas/,/staking/pools/,/staking/withdrawals/render with the staking dropdown, hero, and the community callout below content/use-cases/subpages render with the use-cases dropdown, hero, and the "edit this page" banner/roadmap/security/,/roadmap/scaling/,/roadmap/user-experience/,/roadmap/future-proofing/render with the roadmap dropdown/roadmap/beacon-chain/and/roadmap/merge/(template: upgrade) render with the upgrade dropdown and show "page last updated: ..." under the summary list/es/staking/solo/) -- dropdown labels translate/ar/staking/solo/) -- layout is correctly mirrored/developers/docs/getting-started/) still render with syntax highlighting and the copy-to-clipboard widget🤖 Generated with Claude Code