docs: spec + plan for visual parity pass 2

This commit is contained in:
2026-05-21 00:33:19 +02:00
parent 69ae4e0a19
commit 9b18c2965f
2 changed files with 395 additions and 0 deletions
@@ -0,0 +1,238 @@
# Visual Parity Pass 2 — Implementation Plan
**Goal:** Restore the missing team carousel on `/team/`, fix carousel image distortion, clean up markdown / autoescape glitches in `doctors.md` and navbar — closing the regressions reported after Phase 1.5 deploy.
**Architecture:** New `team_carousel.html` macro + `section.html` dispatch by `page.extra.layout`; rewrite `content/team/employees.md` to carry slides as front-matter data; spot fixes in `doctors.md` and `navbar.html`.
**Tech Stack:** Zola 0.22, Tera, Bootstrap 3 (carousel JS already wired in `base.html`), Font Awesome (icons already loaded).
---
## Task 1: Rewrite `content/team/employees.md` with carousel front matter
**Files:**
- Modify: `content/team/employees.md` (full rewrite)
Replace the entire file with TOML front matter holding the five slides and an empty body:
```toml
+++
title = "Unser Praxis-Team"
weight = 20
[extra]
anchor = "employees"
layout = "carousel"
[[extra.slides]]
name = "Frau Berscheidt"
image = "Berscheidt.jpg"
description = "Medizinische Fachangestellte, Diabetes-Assistentin"
[[extra.slides]]
name = "Frau Bolz"
image = "Bolz.jpg"
description = "Medizinische Fachangestellte"
[[extra.slides]]
name = "Frau Frohne"
image = "Frohne.jpg"
description = "Medizinische Fachangestellte"
[[extra.slides]]
name = "Frau Merhof"
image = "Merhof.jpg"
description = "Medizinische Fachangestellte"
[[extra.slides]]
name = "Frau Rodrigues"
image = "Rodrigues.jpg"
description = "Medizinische Fachangestellte"
+++
```
Commit:
```
fix(team): convert employees.md to carousel front-matter data
```
## Task 2: Create `templates/macros/team_carousel.html`
**Files:**
- Create: `templates/macros/team_carousel.html`
```html
{% macro team_carousel(title, anchor, slides) %}
<section class="employees">
<section class="section-title">
<div class="container text-center">
{%- if anchor %}
<div class="anchor" id="{{ anchor }}">
<h2>{{ title }}</h2>
</div>
{%- else %}
<h2>{{ title }}</h2>
{%- endif %}
<span class="bordered-icon"><i class="fa fa-circle-thin"></i></span>
</div>
</section>
<div class="container">
<div id="employeesSlider" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
{%- for slide in slides %}
<div class="item{% if loop.first %} active{% endif %}">
<blockquote>
<ul>
<li><img src="/images/team/{{ slide.image }}" alt="{{ slide.name }}"></li>
<li class="name">{{ slide.name }}</li>
</ul>
<p>{{ slide.description }}</p>
</blockquote>
</div>
{%- endfor %}
</div>
<a class="left carousel-control" href="#employeesSlider" role="button" data-slide="prev">
<span><i class="fa fa-angle-left"></i></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#employeesSlider" role="button" data-slide="next">
<span><i class="fa fa-angle-right"></i></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</section>
{% endmacro %}
```
Commit:
```
feat(templates): add team_carousel macro mirroring live employees block
```
## Task 3: Wire macro into `templates/section.html`
**Files:**
- Modify: `templates/section.html`
Add the macro import alongside the others, and branch on `page.extra.layout` in the child-page loop:
```html
{% extends "base.html" %}
{% import "macros/section_title.html" as st %}
{% import "macros/page_title.html" as pt %}
{% import "macros/team_carousel.html" as tc %}
{% block content %}
{{ pt::page_title(title=section.title) }}
{% if section.content %}
<section class="ptb-100">
<div class="container">
<div class="row"><div class="col-md-12">{{ section.content | safe }}</div></div>
</div>
</section>
{% endif %}
{% for page in section.pages %}
{% if page.extra.layout == "carousel" %}
{{ tc::team_carousel(
title=page.title,
anchor=page.extra.anchor | default(value=page.slug),
slides=page.extra.slides) }}
{% else %}
<section class="text ptb-text">
{{ st::section_title(title=page.title, anchor=page.extra.anchor | default(value=page.slug)) }}
<div class="container">
<div class="row">
{{ page.content | safe }}
</div>
</div>
</section>
{% endif %}
{% endfor %}
{% endblock %}
```
Commit:
```
feat(templates): dispatch section pages by extra.layout for carousel support
```
## Task 4: Fix `<h5>` headings in `content/team/doctors.md`
**Files:**
- Modify: `content/team/doctors.md`
Replace every `#####X` (no space) with `##### X` (with space) — exactly six lines:
- `#####Qualifikation``##### Qualifikation` (3×)
- `#####Tätigkeitsschwerpunkte``##### Tätigkeitsschwerpunkte` (2×)
- `#####Tätigkeitsschwerpunkt``##### Tätigkeitsschwerpunkt` (1×)
- `#####Interessenschwerpunkt``##### Interessenschwerpunkt` (1×)
(Total occurrences: 6 — verified via `grep -c '^#####[^ ]' content/team/doctors.md`.)
## Task 5: Fix `</th>` closing tags in `content/team/doctors.md`
**Files:**
- Modify: `content/team/doctors.md`
Each doctor block has a schedule table with two `<td>…</th>` mismatches in
its first row. Replace `</th>` with `</td>` — six total occurrences.
Combine commits 4+5:
```
fix(content): proper md headings and td closing tags in doctors.md
```
## Task 6: Strip base_url from nav permalinks in `templates/partials/navbar.html`
**Files:**
- Modify: `templates/partials/navbar.html`
For each `<a href="{{ ... .permalink }}">` (two top-level loops, plus the
mobile menu list further down):
- Old: `href="{{ sub.permalink }}"` (etc.)
- New: `href="{{ sub.permalink | replace(from=config.base_url, to='') | safe }}"`
Same treatment for `cpage.permalink` inside the dropdown.
Commit:
```
fix(navbar): render nav hrefs as relative paths to match live markup
```
## Task 7: Build, deploy, verify
- [ ] Run `zola build` from project root. Expect zero warnings/errors.
- [ ] Read `public/team/index.html` and confirm:
- One `<section class="employees">` containing `id="employeesSlider"`.
- Exactly five `<div class="item">` blocks (first with `active`).
- Each item has `<blockquote><ul><li><img src="/images/team/…"></li><li class="name">…</li></ul><p>…</p></blockquote>`.
- No `<p>#####…</p>` literals in the doctors section.
- No `</th>` substrings.
- [ ] Read `public/index.html` and confirm nav `<a href="/services/">` (no `&#x2F;`).
- [ ] `rsync -avz --delete public/ mycelium:~/public/praxis/`.
- [ ] `curl -sI https://preview.praxis-am-lienhardplatz.de/team` → expect `HTTP/2 200`.
- [ ] Final commit on the deploy step:
```
chore(deploy): visual parity pass 2 — team carousel restored, markup cleaned
```
- [ ] `git push origin main`.
---
## Self-review checklist (before exec)
- [x] Every spec finding has a corresponding task.
- [x] No placeholders / TBDs.
- [x] Type consistency: `slides` list, `slide.image`, `slide.name`, `slide.description` are
the same names in employees.md, the macro, and the spec.
- [x] Images path: `static/images/team/<file>.jpg` → served at `/images/team/<file>.jpg`.
- [x] Bootstrap-3 carousel auto-init (`data-ride="carousel"`) — no extra JS needed.
- [x] Footer + base.html unchanged.
@@ -0,0 +1,157 @@
# Visual Parity Pass 2 — Design Spec
**Date:** 2026-05-21
**Phase:** 1.6 (regression follow-up to Phase 1.5)
**Status:** approved (auto-mode, in-session execution)
## Goal
Close the remaining visual gaps reported by the editor after Phase 1.5 deploy:
the team carousel that was silently dropped during the Grav→Zola content port,
the image-size distortion on the employee block, and a small set of markdown
parsing / template autoescape glitches.
## Non-Goals
- No Phase 2 modernization (typography, mobile, accessibility) — still 1:1 parity.
- No CSS edits — the live theme CSS is the contract; we change markup to match it.
- No production cutover. Staging only.
## Reference
- Live source-of-truth (read-only): `/home/brummel/dev/praxis/orig/`
- Current Zola build output: `/home/brummel/dev/praxis/public/`
- Phase 1.5 spec: `docs/specs/2026-05-20-praxis-visual-parity-design.md`
- Phase 1.5 plan: `docs/plans/2026-05-20-praxis-visual-parity.md`
## Findings
### 1. Team carousel missing on `/team/`
Live (`orig/user/themes/praxis/templates/modular/employees.html.twig`) renders a
Bootstrap-3 carousel: `<section class="employees">``<div id="employeesSlider"
class="carousel slide" data-ride="carousel">` with one `.item` per slide
(blockquote / ul / li-img + li.name + p.description), plus `.left/.right
carousel-control` anchors. Source data is a `slides` list in the
`employees.md` front matter. CSS rules in
`orig/user/themes/praxis/css/_style.css:18381846` force `img { width:160px;
height:200px }` for items inside `#employeesSlider .carousel-inner`.
Current Zola output for `/team/` `employees` section is just sequential
`<img class="float-right">` blocks with `<strong>name</strong>` paragraphs —
the carousel container, controls, and item wrapping are entirely missing.
### 2. Image-size distortion (carousel slot only)
`templates/macros/image.html` resizes with `op="fit_width"`. For 311×400
originals at `width=200`, that produces 200×257 — the wrong aspect for the
160×200 CSS slot. The live site avoids this by serving the raw image and
letting CSS pin it to 160×200. Doctor portraits (400×400) and services
thumbnails (600×400) are visually fine; the bug is isolated to the carousel
images.
### 3. `<h5>` headings not parsed in `content/team/doctors.md`
Markdown source has `#####Qualifikation` with no space after the hashes.
Grav's markdown parser was tolerant; pulldown-cmark (Zola) is not — output is
`<p>#####Qualifikation</p>`. Six occurrences across three doctor blocks.
### 4. `</th>` closing tag mismatch in doctors.md tables
`<td>…</th>` pairs in the three doctor schedule tables (six total). Browsers
recover, but the markup is wrong and inconsistent with the live (which uses
`<td>…</td>` everywhere).
### 5. Nav-link URLs HTML-entity-encoded
`templates/partials/navbar.html` renders `{{ sub.permalink }}` and
`{{ cpage.permalink }}` without `| safe`. Tera autoescape converts the
slashes to `&#x2F;`. Functional but markup-ugly and not parity. Live uses
relative paths (`/services/`).
## Architecture
### New: `templates/macros/team_carousel.html`
Renders a `<section class="employees">` block:
- Reuses the section-title structure from `section_title.html` (or inlines it
identically — anchor optional).
- Renders `<div id="employeesSlider" class="carousel slide"
data-ride="carousel">` with `.carousel-inner` containing one `<div
class="item{% if loop.first %} active{% endif %}">` per slide.
- Each item: `<blockquote><ul><li><img src="/images/team/{{ slide.image }}"
alt="{{ slide.name }}"></li><li class="name">{{ slide.name }}</li></ul><p>{{
slide.description }}</p></blockquote>`.
- Carousel controls: `.left` / `.right` anchors with FA `fa-angle-left/right`.
Images are served raw from `static/images/team/` — no `width`/`height`
attribute, no resize_image. The CSS slot (`#employeesSlider .carousel-inner
.item img`) forces the final 160×200 dimensions, exactly as the live site
does it.
### Modified: `templates/section.html`
When iterating `section.pages`, branch on `page.extra.layout`:
- `"carousel"` → call `team_carousel(title, anchor, slides)` macro with
values pulled from `page.extra`.
- otherwise → existing `section_title` + `page.content` render.
### Modified: `content/team/employees.md`
Front matter holds the carousel data; body is empty. Schema:
```toml
+++
title = "Unser Praxis-Team"
weight = 20
[extra]
anchor = "employees"
layout = "carousel"
[[extra.slides]]
name = "Frau Berscheidt"
image = "Berscheidt.jpg"
description = "Medizinische Fachangestellte, Diabetes-Assistentin"
# … repeated for Bolz, Frohne, Merhof, Rodrigues (5 total, matching live order)
+++
```
### Modified: `content/team/doctors.md`
- Replace each `#####X` with `##### X` (six occurrences).
- Replace each `</th>` with `</td>` inside `<td>…</th>` pairs (six occurrences).
### Modified: `templates/partials/navbar.html`
Replace `{{ sub.permalink }}` and `{{ cpage.permalink }}` with the equivalent
relative-path form: `{{ sub.permalink | replace(from=config.base_url,
to='') | safe }}` (and same for `cpage`). Mobile-menu list inside the same
file gets the same treatment.
## Per-Route Definition of Done
- `/team/`:
- `<section class="employees">` present, contains `<div
id="employeesSlider" class="carousel slide" data-ride="carousel">`.
- Exactly five `.item` divs, first with `.active`; each wraps a
`<blockquote><ul>…</ul><p>…</p></blockquote>`.
- `.left` and `.right` carousel-control anchors with `fa-angle-left/right`
icons.
- Carousel `<img>` tags have no `width`/`height` attributes (CSS does the
sizing).
- Doctor block: `<h5>Qualifikation</h5>` and `<h5>Tätigkeitsschwerpunkte</h5>`
(etc.) replace the previous `<p>#####…</p>` literals.
- Doctor schedule tables: zero `</th>` tags in the rendered HTML.
- Site-wide nav: no `&#x2F;` sequences in `<a href>` values.
## Risks / Notes
- The `team_carousel` macro intentionally duplicates the section-title
markup rather than reusing `section_title.html`, because the live theme
wraps it in `<section class="employees">` and the empty-anchor branch is
different. Keeping it inline avoids a fragile macro-of-macro chain.
- `page.extra.layout == "carousel"` is the dispatch key. If we later add
other layouts (`map`, `news`, etc. — the live theme has those as modular
templates), the same dispatch extends naturally.
- Image-macro stays unchanged; the carousel deliberately bypasses it.