Skip to content

Commit 1e4e755

Browse files
committed
feat(gallery): redesign gallery with intent-driven landing
Replace the single carousel gallery with an intent-driven landing and six category spoke pages. The landing offers a category chooser, a section rail, and curated featured examples with animated hover previews; each spoke page lists its examples with keyboard-operable category filters and working sort and search. Drive every card from YAML under docs/gallery/data/, with a curated featured.yml and per-category lists, and single-source the feature links and browse chips from that data. Consolidate thumbnails under thumbnails/ and add capture tooling for still, PDF, and video previews, documented in READMEs. Meet WCAG AA on the interactive chips and heading order, keep the legacy implementation for reference, and skip the freeze check for the intentionally deleted freeze entry.
1 parent 29bccf3 commit 1e4e755

190 files changed

Lines changed: 3309 additions & 319 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.githooks/check-freeze.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@ while IFS= read -r qmd; do
3939
[ -n "$qmd" ] || continue
4040
freeze_rel="_freeze/${qmd%.qmd}/execute-results/html.json"
4141

42+
# Skip when the freeze file is intentionally removed in this change: the
43+
# page no longer executes code (e.g. converted to the markdown engine), so
44+
# its freeze entry is vestigial and correctly deleted, not stale.
45+
if [ "$MODE" = "commit" ]; then
46+
if git diff --cached --diff-filter=D --name-only 2>/dev/null | grep -Fxq "$freeze_rel"; then
47+
continue
48+
fi
49+
else
50+
if git diff "${REMOTE}..HEAD" --diff-filter=D --name-only 2>/dev/null | grep -Fxq "$freeze_rel"; then
51+
continue
52+
fi
53+
fi
54+
4255
# Read freeze JSON from git objects, not working tree, to avoid false passes
4356
# when the freeze file is updated on disk but not yet staged.
4457
if [ "$MODE" = "commit" ]; then

‎.github/workflows/preview.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,14 @@ jobs:
210210
'docs/extensions/listings/custom-formats.yml': 'docs/extensions/index.html',
211211
'docs/extensions/listings/revealjs-formats.yml': 'docs/extensions/index.html',
212212
'docs/extensions/listings/revealjs.yml': 'docs/extensions/index.html',
213-
// Gallery data files → gallery index
214-
'docs/gallery/carousel.yml': 'docs/gallery/index.html',
215-
'docs/gallery/gallery.yml': 'docs/gallery/index.html',
213+
// Gallery data files → gallery pages
214+
'docs/gallery/data/featured.yml': 'docs/gallery/index.html',
215+
'docs/gallery/data/reports-analytics.yml': 'docs/gallery/reports-analytics.html',
216+
'docs/gallery/data/dashboards-monitoring.yml': 'docs/gallery/dashboards-monitoring.html',
217+
'docs/gallery/data/research-scholarship.yml': 'docs/gallery/research-scholarship.html',
218+
'docs/gallery/data/teaching-learning.yml': 'docs/gallery/teaching-learning.html',
219+
'docs/gallery/data/software-documentation.yml': 'docs/gallery/software-documentation.html',
220+
'docs/gallery/data/personal-community.yml': 'docs/gallery/personal-community.html',
216221
// Guide listing → guide index
217222
'docs/guide/guide.yml': 'docs/guide/index.html',
218223
// Download data → download index

‎_freeze/docs/gallery/index/execute-results/html.json‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎_quarto.yml‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,19 @@ website:
111111
- text: "Tutorial: Authoring"
112112
href: docs/get-started/authoring/
113113

114+
- id: gallery
115+
contents:
116+
- section: "Gallery"
117+
href: docs/gallery/index.qmd
118+
contents:
119+
- docs/gallery/reports-analytics.qmd
120+
- docs/gallery/dashboards-monitoring.qmd
121+
- docs/gallery/research-scholarship.qmd
122+
- docs/gallery/teaching-learning.qmd
123+
- docs/gallery/software-documentation.qmd
124+
- docs/gallery/personal-community.qmd
125+
- docs/gallery/browse.qmd
126+
114127
- id: guide
115128
collapse-level: 1
116129
contents:
@@ -684,8 +697,8 @@ format:
684697
respect-user-color-scheme: true
685698
toc: true
686699
theme:
687-
light: [cosmo, theme.scss]
688-
dark: [cosmo, theme-dark.scss]
700+
light: [cosmo, theme.scss, docs/gallery/assets/_gallery.scss]
701+
dark: [cosmo, theme-dark.scss, docs/gallery/assets/_gallery.scss]
689702
code-copy: true
690703
code-overflow: wrap
691704
css: styles.css

‎_tools/screenshots/README.md‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Screenshot and preview tooling
2+
3+
Scripts to capture and update quarto-web's documentation images and gallery media.
4+
5+
There are two families.
6+
Doc screenshots come from `manifest.json` through `capture.js`.
7+
Gallery assets come from `docs/gallery/data/*.yml` through the `scripts/capture-*.mjs` scripts.
8+
9+
Run every command from `_tools/screenshots/`.
10+
11+
## Which tool makes what
12+
13+
| Asset | Command | Script | Output |
14+
| ----------------------------------------- | ----------------------------- | ---------------------------------- | ----------------------------------------------- |
15+
| Doc screenshots (PNG, light and dark) | `npm run capture` | `capture.js` (manifest) | `docs/**/images/*.png` |
16+
| Gallery hover previews (webm and mp4) | `npm run capture:previews` | `scripts/capture-previews.mjs` | `docs/gallery/thumbnails/featured/*.{webm,mp4}` |
17+
| Gallery PDF card thumbnails (PNG) | `npm run capture:pdf-thumbs` | `scripts/capture-pdf-thumbs.mjs` | `docs/gallery/thumbnails/**/*.png` |
18+
| Gallery card thumbnails, image-less (PNG) | `npm run capture:card-thumbs` | `scripts/capture-card-thumbs.mjs` | `docs/gallery/thumbnails/<category>/<slug>.png` |
19+
| axe DevTools console (PNG, manual, macOS) | see script header | `scripts/capture-axe-devtools.mjs` | `docs/output-formats/images/axe-console.png` |
20+
21+
Only `npm run capture:previews` makes the mp4 and webm hover clips.
22+
23+
Each `capture:*` gallery command takes `-- --name <pattern>` to match a subset.
24+
Each also takes `-- --limit <n>` to stage the first `n` matches.
25+
26+
## Prerequisites at a glance
27+
28+
All commands need Node.js 18+ and this tool's dependencies (`npm install`, then `npx playwright install chromium`).
29+
30+
`capture:previews` also needs ffmpeg on `PATH` and a full Playwright Chromium; set `PREVIEW_CHROME` to point at it because the headless shell cannot record video.
31+
32+
`capture:pdf-thumbs` also needs poppler (`pdfinfo`, `pdftoppm`) and ImageMagick (`magick`).
33+
34+
Full setup steps are in `SETUP.md`.
35+
The gallery prerequisites are detailed in `scripts/PREVIEWS.md`.
36+
37+
## Where to read next
38+
39+
`SETUP.md` covers install steps and the still-screenshot workflow.
40+
`scripts/PREVIEWS.md` covers gallery video previews plus PDF and card thumbnails in detail.
41+
`docs/gallery/README.md` covers how to add the gallery entries these thumbnails serve.
42+
`CLAUDE.md` covers the AI-assisted workflow and the `manifest.json` field reference.
43+
`DECISIONS.md` covers why the tooling is built the way it is.
44+
`npm run help` prints the full command list.

‎_tools/screenshots/SETUP.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ playwright-cli -s=screenshot screenshot --filename=docs/websites/images/about-jo
6161
playwright-cli -s=screenshot close
6262
```
6363

64+
## Gallery featured video previews
65+
66+
`scripts/capture-previews.mjs` (`npm run capture:previews`) records the animated preview
67+
clips for featured gallery cards. It is separate from the still-screenshot manifest and
68+
needs ffmpeg plus a full Playwright Chromium. See **`scripts/PREVIEWS.md`** for details.
69+
6470
## Optional: PNG Compression
6571

6672
```bash

‎_tools/screenshots/package-lock.json‎

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎_tools/screenshots/package.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,21 @@
88
"serve": "node scripts/serve.js",
99
"compress": "node scripts/compress.js",
1010
"capture": "node capture.js",
11+
"capture:previews": "node scripts/capture-previews.mjs",
12+
"capture:pdf-thumbs": "node scripts/capture-pdf-thumbs.mjs",
13+
"capture:card-thumbs": "node scripts/capture-card-thumbs.mjs",
1114
"open": "node scripts/open.js",
1215
"validate": "node scripts/validate.js",
1316
"update-demo": "bash scripts/update-demo.sh"
1417
},
1518
"dependencies": {
1619
"ajv": "^8.18.0",
20+
"js-yaml": "^5.2.3",
1721
"open": "^10.0.0",
1822
"playwright": "^1.50.0",
1923
"sharp": "^0.33.0"
24+
},
25+
"allowScripts": {
26+
"sharp@0.33.5": true
2027
}
2128
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Gallery featured video previews
2+
3+
`capture-previews.mjs` generates the short, muted, looping clips that featured
4+
gallery cards play on hover or keyboard focus. The rendering,
5+
interaction, and reduced-motion handling live in the gallery, not here:
6+
`docs/gallery/assets/_featured.ejs.md` and `docs/gallery/assets/_gallery.scss`.
7+
8+
This script is separate from the still-screenshot manifest (`capture.js`): it
9+
records motion rather than a single frame, and is driven by gallery data rather
10+
than `manifest.json`.
11+
12+
## How it works
13+
14+
- Driven by `docs/gallery/data/featured.yml`: every card with both a `live` URL
15+
and a `preview` base path gets a clip. `preview:` is the output path without
16+
extension, e.g. `thumbnails/featured/software-documentation-gribouille`.
17+
- Optional `preview-url:` overrides the page that is recorded when the card's
18+
`live` link is not the best source (e.g. a landing page vs a richer subpage). The
19+
card's `live` link is unchanged; only the capture source differs.
20+
- Output: `<preview>.webm` (VP9) and `<preview>.mp4` (H.264) under
21+
`docs/gallery/thumbnails/featured/` (animated previews are a featured-only
22+
asset), beside the still PNG (`image:`), which stays the `<video>` poster.
23+
- Capture mode comes from the card's `categories`:
24+
- **reveal.js** (`revealjs`/`presentation`) → step through a few slides with
25+
ArrowRight.
26+
- **everything else** → scroll the page top to bottom.
27+
- The blank page-load lead-in is measured and trimmed from the encode, so clips
28+
open on real content and loop without a white flash.
29+
- Each file is size-budgeted; the script warns above 500 KB.
30+
31+
Cards without a `preview:` field keep the static PNG. Leave it off for pages that
32+
do not benefit: single-screen dashboards, PDF/blob `live` URLs, or sites that block
33+
headless capture.
34+
35+
## Prerequisites
36+
37+
- **ffmpeg** on `PATH` (`brew install ffmpeg`). Playwright records VP8 webm only;
38+
ffmpeg re-encodes to a smaller VP9 webm and an H.264 mp4 for Safari/broad support.
39+
- **A full Playwright Chromium** — the headless shell cannot record video. The
40+
script defaults to the installed `chromium-*/chrome-mac-arm64` build; set
41+
`PREVIEW_CHROME` to override the path (`npx playwright install chromium`).
42+
- **This tool's dependencies installed** — `npm install` in `_tools/screenshots`
43+
(the script uses the tool's `playwright` and `js-yaml`).
44+
45+
## Usage
46+
47+
From `_tools/screenshots`:
48+
49+
```bash
50+
npm run capture:previews # every preview card
51+
npm run capture:previews -- --name whr # match by name or preview path
52+
npm run capture:previews -- --limit 2 # first N matches (staging)
53+
```
54+
55+
After capturing, re-render the landing (`quarto render docs/gallery/index.qmd`) and
56+
check the clips in the browser in both themes.
57+
58+
# PDF card thumbnails
59+
60+
`capture-pdf-thumbs.mjs` builds the still `image` for cards whose `live` URL is a
61+
PDF, rendering the PDF's first two pages (or the first page alone when it has only
62+
one) into a side-by-side spread that overwrites the card's existing thumbnail.
63+
64+
- Driven by `docs/gallery/data/*.yml`: every card with a `.pdf` `live` URL. GitHub
65+
`blob` URLs are rewritten to `raw.githubusercontent.com` before download.
66+
- Output: overwrites the card's `image` PNG under `docs/gallery/thumbnails/`.
67+
- Prerequisites: **poppler** (`pdfinfo`, `pdftoppm`) and **ImageMagick** (`magick`)
68+
on `PATH` (`brew install poppler imagemagick`).
69+
70+
```bash
71+
npm run capture:pdf-thumbs # every PDF-linked card
72+
npm run capture:pdf-thumbs -- --name whr # match by name or image path
73+
npm run capture:pdf-thumbs -- --limit 1 # first N matches (staging)
74+
```
75+
76+
# Card thumbnails for image-less entries
77+
78+
`capture-card-thumbs.mjs` fills the `image` for cards that have none yet and whose
79+
`live` URL is a normal web page (PDF-linked cards go through `capture-pdf-thumbs.mjs`).
80+
It screenshots the page top to `docs/gallery/thumbnails/<category>/<slug>.png`,
81+
dismissing a cookie/consent banner first, then prints the `image:` and a placeholder
82+
`alt:` line to add to the card (it does not edit the YAML).
83+
84+
```bash
85+
npm run capture:card-thumbs # every image-less web card
86+
npm run capture:card-thumbs -- --name rap # match by name
87+
npm run capture:card-thumbs -- --limit 1 # first N matches (staging)
88+
```

0 commit comments

Comments
 (0)