Skip to content

feat(approach): add numbered split layout variant - #181

Merged
markdumay merged 2 commits into
mainfrom
feat/approach-numbered-split
Jul 28, 2026
Merged

feat(approach): add numbered split layout variant#181
markdumay merged 2 commits into
mainfrom
feat/approach-numbered-split

Conversation

@markdumay

@markdumay markdumay commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Extends the approach component with two opt-in, backward-compatible arguments, ported from a proven site-local component:

  • numbered: true — elements are auto-numbered with digit glyphs (19) in a tinted circle; per-element icon/image are ignored. Works in both layouts. The glyph is passed to assets/icon.html as a bare, family-less name, so it resolves through site.Params.modules.fontawesome.defaultFamily like any other bare icon reference — mod-fontawesome defaults that to fas (Font Awesome Solid), so digits render as FA out of the box; a theme that prefers a different family gets it automatically by overriding defaultFamily, no extra argument needed.
  • layout: "split" — renders the heading in a left column with the elements as a vertically stacked list on the right (50-50 on md+, stacked on mobile), as an alternative to the card grid.

Defaults preserve current behavior: the default-path rendered HTML (grid, unnumbered) is byte-identical before/after this change.

Notes for review

  • numbered is declared as a bool in the approach.yml sidecar — mod-utils v6 has no global definition for it, and omitting the declaration fails schema compilation for every existing approach block.
  • Split-layout classes are namespaced under the component (approach-steps / approach-step / approach-number), including a dark-mode variant for the number circle.
  • The digit glyph is rendered with spacing: false — the icon partial's trailing   otherwise becomes a second grid item inside the circle and skews centering.
  • Design call worth a look: in the grid layout, numbered reuses the existing card-icon-primary circle treatment; the .approach-number style applies in split layout. Unify if you prefer one treatment.
  • Known limitation: digit glyphs exist for 09 only (whatever family defaultFamily resolves to); 10+ numbered elements would need skipMissing.

Verification

  • pnpm install + pnpm build (exampleSite) clean at every stage; Husky pre-commit and commitlint hooks pass.
  • All four layout/numbered combinations manually verified against rendered HTML via a temporary exampleSite demo (scratch content only — no extra module needed, since Font Awesome is already hinode's default), fully reverted before committing. Confirmed the resolved digit glyphs render as real FA SVG symbols (<use href="#fas-1"/> etc.), not just that the template compiles.

🤖 Generated with Claude Code

markdumay and others added 2 commits July 28, 2026 16:00
Add two opt-in, backward-compatible arguments to the approach
component, ported from a proven site-local "steps" component:

- numbered: auto-number each element with a Flaticon digit glyph
  (fi-br 1..9) in a tinted circle, ignoring any per-element icon or
  image. Independent of layout; the card grid reuses the existing
  card-icon-primary circle treatment for the digit glyph.
- layout: "split" renders the heading in a left column and the
  elements as a vertically stacked list in a right column (50-50 on
  md+, stacked on mobile), instead of the card grid.

Both default to the current behavior. A diff of the default-path
rendered HTML (grid layout, unnumbered) confirms it is byte-
identical to before this change.

Declares "numbered" as a bool argument via the approach.yml sidecar,
since mod-utils v6's schema compiler has no global definition for
it and would otherwise fail schema compilation for every existing
approach block, not just ones that set it.

Split-layout markup/classes are namespaced under approach
(approach-steps/approach-step/approach-number) since "steps" is not
this component's name. Unlike the reference, per-element content is
still passed through page.RenderString (matching approach's
existing card-grid behavior) and the split heading still honors the
justify argument (matching approach's other common-arg handling).

Verified with a temporary exampleSite demo (mod-flaticon module +
scratch content covering all four layout/numbered combinations),
reverted before committing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pass the numbered-glyph icon as a bare digit ("1".."9") instead of
hardcoding the Flaticon "fi-br" family. assets/icon.html treats a
single-token icon as family-less and resolves it through
site.Params.modules.fontawesome.defaultFamily, which mod-fontawesome
itself defaults to "fas" (Font Awesome Solid) — verified the FA6/7
solid set ships digit glyphs 0-9 and that the resolved SVG symbols
render in the exampleSite build, not just that the template compiles.

Flaticon was an infusal-theme choice bleeding into hinode core's
default; a theme that wants a different family now gets it for free
by overriding defaultFamily, with no new argument needed here. Size
classes ("fa-lg") move to the icon partial's separate "class" key,
since embedding them in the icon string would make it a two-token
value and skip the default-family resolution.

Re-ran the byte-identical default-path diff and the four-combination
render check (grid/split x numbered/plain) against real output HTML;
all four resolve real FA SVG symbols. No new exampleSite dependency
needed this time, since Font Awesome is already hinode's default.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@markdumay
markdumay merged commit d8c1b89 into main Jul 28, 2026
8 checks passed
@markdumay

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 2.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant