Prohlížeč zdrojového kódu
docs/specs/home-page.md
Spec: Home Page
- Status: active
- Created: 2026-03-05
- Related code:
app/controllers/pages_controller.rb,app/views/pages/home.html.erb,app/assets/stylesheets/_home.scss
Overview
The home page is the entry point for the portfolio. It introduces the site and its author, and gives visitors two clear paths: browsing code examples or viewing the application's source code. It also surfaces a preview of up to six examples as an at-a-glance showcase.
Behaviour
Hero section
- A centred hero section displays the site title ("Ruby Webování - Petr Šedivý") and a brief description of what visitors can do.
- Two CTA links are shown: "Procházet příklady" (→
/examples) and "Zobrazit zdroj" (→/source).
Examples preview
- Up to six examples are shown below the hero as cards (in position order).
- Each card shows the example's title (as a link to its detail page), description, and tags.
- If no examples exist, the preview section is omitted entirely.
Routes
GET /→pages#home
Implementation Notes
PagesController#homeloads examples viaExampleRegistry.all.first(6)— no DB query, purely file-based.- The
.heroclass is styled in_home.scssas a centred section. - The examples grid uses the shared
.examples-gridclass (defined in_cards.scss), the same grid used on the examples index page.
Tests
spec/requests/pages_spec.rb— smoke tests: HTTP 200 and presence of site title in response body.
See Also
- Examples System —
ExampleRegistrysupplies the examples shown in the preview; the card layout is shared with the examples index. - Styling and CSS —
_home.scssprovides the.herostyles;_cards.scssprovides.examples-gridand.tag.
Change Log
- 2026-03-05: Initial retrospective spec written.