diff --git a/CLAUDE.md b/CLAUDE.md index fceb222..fccabb9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -17,7 +17,7 @@ Kestrel's Builds is a static site of craft build write-ups. Builds vary (foam an - Everything in `greenman/` is generated by `greenman-src/`: run `uv run build.py` there and it rewrites `greenman/index.html`, `img/`, `dl/` and `og-image.jpg`. Never hand-edit `greenman/`; change the source and rebuild. The back links, favicon line, description, canonical and Open Graph tags are all written by `greenman-src/build_web.py`. - `deploy` must never upload a generator. Any new source folder must be named `-src/` so the existing exclude covers it; check with `./deploy -n`. - Keep the apostrophe in the index's `` written as `'`. It is deliberate: the opengraph.xyz preview checker cut the description off at a plain apostrophe. -- Visits are counted by GoatCounter, the same site code as the blog (`kestrelsnest`). Every page carries the two-line snippet in its head; the first line prefixes the path with the host, so `/` here is recorded as `builds.kestrelsnest.social/` and does not merge with the blog's `/`. In `greenman/` it is written by `ANALYTICS` in `greenman-src/build_web.py`. +- Visits are counted by GoatCounter, the same site code as the blog (`kestrelsnest`). Every page carries the two-line snippet in its head; the first line prefixes the path with the host, so `/` here is recorded as `builds.kestrelsnest.social/` and does not merge with the blog's `/`. In `greenman/` it is written by `ANALYTICS` in `greenman-src/build_web.py`. GoatCounter only sees page views, so each download button also carries `data-goatcounter-click`, which records a click as an event named after the file's full path (`builds.kestrelsnest.social/greenman/dl/`). Give a new build's download links the same attribute. - Share previews: `og.png` at the root is a 1200x630 screenshot of the top of the index, so retake it when the index's first card changes. Each build has its own `og-image.jpg` (1200x630) in its folder and its own description and Open Graph tags. ## Adding a build diff --git a/greenman-src/build_web.py b/greenman-src/build_web.py index 56c31b1..590ec9d 100644 --- a/greenman-src/build_web.py +++ b/greenman-src/build_web.py @@ -13,6 +13,8 @@ OG_ALT = 'A Green Man half-mask worn with glasses: a crown of painted oak leaves # The same GoatCounter site as the blog. Paths are prefixed with the host so this site's pages do not merge with the blog's. ANALYTICS = ''' ''' +# A click on a download button is counted as an event named like a page path, e.g. builds.kestrelsnest.social/greenman/dl/GreenMan_templates.pdf +EVENT_PREFIX = URL.removeprefix('https://') CSS = ''' /* Same ink, bone and gold as the builds index and Kestrel's Hall, and the same serif. Drawings stay on light paper with sans labels. @@ -80,7 +82,7 @@ def build(out=str(OUT / 'index.html')): body = C.construction(); paint_html = C.painting().replace('
', '
').replace('

Green Man mask

', '

Painting the mask

') dls = [('GreenMan_mask_kit.zip', 'Whole kit', 'Templates, both guides, and the 8 print files in one zip'), ('GreenMan_templates.pdf', 'Templates', '4 pages, 1:1, US Letter or A4'), ('GreenMan_build_guide.pdf', 'Build guide', 'Printable, for the workbench'), ('GreenMan_painting_guide.pdf', 'Painting guide', 'Printable'), ('GreenMan_print_files.zip', 'Print files', '8 STL files, no supports needed')] - downloads = ('

Downloads

' + ''.join(f'{t}{d}' for f, t, d in dls) + '
') + downloads = ('

Downloads

' + ''.join(f'{t}{d}' for f, t, d in dls) + '
') nav = '' i = body.index('
') + len('
') body = body[:i] + nav + downloads + '
' + body[i:] diff --git a/greenman/index.html b/greenman/index.html index 97e88d5..f4b4fe3 100644 --- a/greenman/index.html +++ b/greenman/index.html @@ -86,7 +86,7 @@ table.dense { font-size: 0.8rem; min-width: 760px; }

(Don’t wear glasses? No worries, I’ve made a variation for you too!)

Hands-on time
about 8 hours over 3 evenings
Printing
16 small parts, printed unattended
Foam
1 base, 27 leaves
Skills
craft knife, heat gun, contact cement
-
The finished mask, worn with a knitted hood.
The finished mask, worn with a knitted hood.

Downloads

Tested in use

+
The finished mask, worn with a knitted hood.
The finished mask, worn with a knitted hood.

Downloads

Tested in use

This mask was built and then worn for a full day at a renaissance faire, glasses and all. It stayed comfortable, nothing came loose, and it needed no repairs. The photos throughout this guide are from that build.

The templates and print files have been refined a little since then, so dry-fit the parts against your own base before gluing, as the guide suggests.

How it goes together

The base is a band of 6 mm foam across the forehead with a strip down the nose and a tab on each cheek. It is worn behind your glasses, so the frame rests on the foam and nothing surrounds the lenses.