Skip to content

feat(landing): optional hero logo for DocsUI::Landing (c.landing.logo)#57

Merged
mhenrixon merged 1 commit into
mainfrom
feat/landing-logo
Jul 4, 2026
Merged

feat(landing): optional hero logo for DocsUI::Landing (c.landing.logo)#57
mhenrixon merged 1 commit into
mainfrom
feat/landing-logo

Conversation

@mhenrixon

Copy link
Copy Markdown
Owner

Why

DocsUI::Landing (shipped in #55 / v1.0.5) renders a hero of eyebrow + title + lead — but no way to show the product's own brand mark. That's the first thing a real consumer hits: adopting the component on a mounted docs app (a fintech app's /docs), the hand-rolled hero had an inline logo, and moving to the gem component would have dropped it. This adds the missing slot so the gem is a strict upgrade for that case.

What

An optional c.landing.logo, rendered above the eyebrow, in two forms:

# inline single-path SVG mark — fill: currentColor, so it adapts to the theme
c.landing.logo = { svg: "M4 2h9l5 5…Z", viewbox: "0 0 22 24", label: "Acme" }

# or an image — resolved through the site's asset pipeline (image_url)
c.landing.logo = { src: "logo.svg", alt: "Acme" }

nil (the default) omits it, so it's fully backwards-compatible — an existing DocsUI::Landing render is byte-identical.

  • Normalized into a DocsKit::LandingConfig::Logo value object (#hero_logo), mirroring Cta / Feature.
  • The inline form renders a <svg role="img" aria-label fill="currentColor"> with the path; the image form an <img>.
  • Dogfooded on the docs-kit site (c.landing.logo = an inline stacked-docs glyph), with a docs_chrome system-spec assertion (svg[aria-label='docs-kit']).
  • The generator initializer template and the component doc comment document it.

Tests

  • spec/docs_kit/landing_config_spec.rb#hero_logo normalization (inline vs image, default viewbox, inline?).
  • docs/spec/system/docs_chrome_spec.rb — the rendered logo on the dogfood landing.

Full gem suite 759 examples, 0 failures, 94.73% line coverage; rubocop clean (131 files); dogfood system + request specs green.

Note

app/components/docs_ui/landing.rb is added to the Metrics/ClassLength exclude (alongside the OpenAPI composite renderers) — it's a multi-section renderer (logo + hero + feature grid + doc index) where each method is small; the length is section count, not complexity.

DocsUI::Landing's hero was eyebrow + title + lead, with no way to show a product's
own brand mark — the first thing a real consumer hit when adopting it on a mounted
docs app. Add an optional hero logo above the eyebrow, in two forms:

- inline single-path SVG: { svg: "<path d>", viewbox:, label: } — rendered with
  fill: currentColor so a single-color mark adapts to the theme (light/dark);
- image: { src:, alt: } — resolved through the site's asset pipeline (image_url).

nil (the default) omits it, so it's fully backwards-compatible. Normalized into a
DocsKit::LandingConfig::Logo value object (like Cta/Feature). Dogfooded on the
docs-kit site (an inline stacked-docs glyph) with a system-spec assertion; the
generator initializer + component docs document it.

Full gem suite 759 green, 94.73% line coverage, rubocop clean; dogfood system +
request specs green.
@mhenrixon mhenrixon merged commit 52fa316 into main Jul 4, 2026
5 checks passed
@mhenrixon mhenrixon deleted the feat/landing-logo branch July 4, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant