Commit 469c17b
authored
feat: editorial CV pipeline — real HTML/PDF rendering, Lighthouse 100 (#3)
## Why
PDFs were broken (the CI workflow deliberately forced a fallback Python
script that emitted a 1-page text-only PDF stub) and the HTML had none
of the metadata/semantics needed for decent Lighthouse scores. This
rebuild swaps the whole pipeline for a Python + Jinja2 + Markdown +
WeasyPrint setup with an editorial visual treatment.
## What changes
**Pipeline (replaces forced-fallback build):**
- `scripts/build.py` — single entrypoint, reads `src/cv-*.de.md` (YAML
front-matter + Markdown), renders through Jinja2 templates, writes
`public/cv-*.de.html` and matching PDFs via WeasyPrint, plus
`public/index.html` landing page.
- `templates/base.html.j2` + `cv.html.j2` + `index.html.j2` own the full
` <head>`: title, description, canonical, OG profile tags, Twitter card,
JSON-LD `schema.org/Person`, favicon, font preloads.
- Drops the `__missing_pandoc__` / `__missing_weasyprint__` overrides;
deletes `scripts/render_html.py` and `scripts/render_pdf.py`.
- Drops committed `public/*` — it's now gitignored and built fresh in CI
on every push/PR.
**Visual (editorial / serif / typographic):**
- Self-hosted variable fonts: Source Serif 4 (body) + Inter (UI), both
OFL, ~50 KB each.
- Warm off-white page `#fbfaf6`, high-contrast text (>16:1), deep wine
accent `#7d2d3a` (>5.7:1).
- Section labels in small-caps Inter; bullet markers in accent color;
hairline rules between sections; no boxes/cards.
- Print stylesheet: A4 portrait, 18mm margins, page numbers via `@page`
footer, `break-inside: avoid` on roles, link URLs revealed on print.
**Accessibility / SEO / best-practices wins:**
- Skip-link, semantic `<main>` / `<header>` / `<footer>`, single `<h1>`
per page, descriptive `aria-label` on PDF links, `aria-current` on
active variant, `rel=me` on profile links.
- `<title>`, `<meta name=description>`, `theme-color`, `link
rel=canonical`, `link rel=icon` favicon.svg, `link rel=alternate
type=application/pdf`.
- Open Graph profile tags + JSON-LD `Person` for richer
LinkedIn/Twitter/Google previews.
**CI:**
- New `lighthouse` job runs
[`treosh/lighthouse-ci-action@v12`](https://github.com/treosh/lighthouse-ci-action)
on every PR with the built `public/` as fixture.
- `.lighthouserc.json` asserts **a11y / BP / SEO at 1.0** and
performance at 0.95 (will fail the PR check if any drops).
- Pages deploy is unchanged otherwise.
## Local Lighthouse results (desktop preset)
Verified on all three pages before opening this PR:
| Page | Performance | A11y | Best Practices | SEO |
|---|---|---|---|---|
| `index.html` | 100 | 100 | 100 | 100 |
| `cv-executive.de.html` | 100 | 100 | 100 | 100 |
| `cv-technical.de.html` | 100 | 100 | 100 | 100 |
Compare to the previous numbers (a11y 87, SEO 80, best-practices 96).
## PDFs
Both PDFs now render through real WeasyPrint, not the 1-page text stub.
~36 KB each, 2 pages, with running headers, page numbers, and the same
editorial typography as the screen version.
## How to verify locally
```bash
sudo apt-get install -y libpango-1.0-0 libpangoft2-1.0-0 libharfbuzz0b libcairo2 libgdk-pixbuf-2.0-0
make install build serve # http://localhost:8000
make lighthouse # writes lighthouse-*.html per page
```
## Notes / trade-offs
- Repo grew by ~200 KB of self-hosted fonts (4 woff2 files). In exchange
we drop external CDN requests, get full CSP/best-practices score, and
avoid Google Fonts privacy footprint.
- `public/` is no longer in git history going forward (already removed
in this PR; old commits keep their copies — fine).25 files changed
Lines changed: 920 additions & 482 deletions
File tree
- .github/workflows
- assets
- fonts
- public
- scripts
- src
- templates
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | | - | |
| 31 | + | |
26 | 32 | | |
27 | 33 | | |
28 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
29 | 42 | | |
30 | 43 | | |
31 | | - | |
| 44 | + | |
32 | 45 | | |
33 | | - | |
34 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
35 | 49 | | |
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
39 | 53 | | |
40 | 54 | | |
41 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
42 | 92 | | |
43 | 93 | | |
44 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
59 | 38 | | |
60 | 39 | | |
61 | | - | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
26 | 32 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
31 | | - | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | | - | |
| 41 | + | |
35 | 42 | | |
36 | 43 | | |
37 | | - | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | | - | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | | - | |
| 50 | + | |
44 | 51 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
48 | 56 | | |
49 | | - | |
| 57 | + | |
50 | 58 | | |
51 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
52 | 62 | | |
53 | | - | |
| 63 | + | |
54 | 64 | | |
55 | | - | |
| 65 | + | |
| 66 | + | |
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 commit comments