Repository navigation
Redesign: share images and favicon - #37
Conversation
Each article gets its own 1200x630 share image (its title, date and reading time) at /articles/<slug>/share.png, and Home and About share /share.png, with the label "Projects · Writing", the home intro and the article and project counts. Activity logs use the site's image. They replace og-default.jpg as og:image and twitter:image, now with their size and alt text. The favicon is the paper tile: favicon.svg (the 32px tile), a favicon.ico at 16px and 32px and a 180px apple-touch-icon. They replace Astro's default logo on every page, the 404 and /documents/ included. Everything is drawn from the site's DejaVu Sans Mono subset, read with fontkitten and turned into SVG paths laid out as the browser lays out text, then rasterised with sharp. The values are those of docs/redesign/paper/README.md. src/data/projects.ts is a minimal project list for the count, until #32's replaces it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013MdjUerTCBDeF5DG9puDd2
|
Preview: https://pr-37-meaningfool.josselin-perrus.workers.dev Built from 9fab9bf with the latest content. The link stays the same and shows the latest push. Search engines are asked not to index it. |
At 230 words a minute, "Agent Frameworks for the Rest of Us" came out at 40 minutes, where the approved prototype shows 39. Any rate from 231 to 236 gives the prototype's reading time for all 18 articles; only that article's share image and alt text change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013MdjUerTCBDeF5DG9puDd2
|
Review checkpoint: accepted at Fix pushed (1 commit, What I checked
Not blocking (P3): a title that ends in "?" gives a Generated by Claude Code |
Brings in the share images and favicon (#37). Layout keeps their share prop and adds textColumn and noindex next to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013MdjUerTCBDeF5DG9puDd2
Implements #34 (part of #35). The build draws the share images and the favicon from the designs in
docs/redesign/paper/.What changes
/articles/<slug>/share.png: "Article" on the tab, the title, then "Josselin Perrus" and " · min read" at the bottom./share.png. It has the README's updated text: "Projects · Writing" on the tab and the home intro under the name. The bottom row reads "meaningfool.net" and "18 articles · 3 projects", counted at build time. Only articles are counted, not activity logs./share.png.og-default.jpginog:image,twitter:imageand the article JSON-LDimage. Pages now also sendog:image:width/height(1200×630) and an alt text (og:image:alt,twitter:image:alt).public/og-default.jpgis removed./favicon.svgis the 32px tile, with the glyphs as paths./favicon.icoholds the 16px and 32px tiles./apple-touch-icon.pngis 180px.Faviconscomponent links them from every page, including the 404 and/documents/. Astro's default logo (public/favicon.svg) is removed.src/lib/mono.tsreads the site's own DejaVu Sans Mono subset (src/fonts/dejavu-sans-mono.woff2, imported with?inline) withfontkittenand turns the text into SVG paths. It lays text out the way the browser does: same character width plus letter-spacing, lines breaking at spaces and after hyphens, and CSS line-box baselines.src/lib/share-images.tsandsrc/lib/favicon.tsuse the README's exact values, andsharprasterises the result. Both packages were already installed through Astro and are now listed as direct dependencies, sobun.lockgains no new packages. Playwright isn't used.src/lib/share.ts: the text, paths and alt text of the images.src/lib/reading-time.mjs: words at 235 a minute, rounded up. This gives the prototype's reading times for all 18 of its articles (any rate from 231 to 236 does).Why the subset font, and not full TTFs
fontkittenreads WOFF2, so the committed 24 KB subset works as it is. That means no font download at build time, no new font files and no licence to add (the DejaVu licence is already insrc/fonts/). The images also have exactly the letters the pages show. The subset covers Latin, punctuation, arrows and box drawing. Any other character (Greek, CJK, emoji) is drawn as the font's empty box, and the build prints a[mono]warning that names it. I checked this with a test title. No current title has such a character.How close they are to the Paper exports (Menlo there, DejaVu Sans Mono here)
structured-extraction, the same title as the export): every row lands within 1px of the export.landihave slabs, and its full stop is bigger.Choices to check
og:image:width/height/alt,twitter:image:alt).Works in parallel with #32
src/data/projects.tswasn't onredesignyet, so this adds a minimal one:export const projects = [...], withslugandnamefor Voice Todos, Agent SDKs for the Rest of Us and Data Lineage. The count comes fromprojects.length. Redesign: article page #32's version will replace this file on merge.src/lib/reading-time.mjs(readingMinutes(article.body)) is here so both show the same number.src/pages/articles/[slug].astrois passingshare={postShare(article)}toLayoutand using its path in the JSON-LDimage. The meta description is untouched.HOME_INTROinsrc/lib/share.ts, which Redesign: home page #31 can import.Validation
Head commit
6250a4e5848fbbbb330724ce58c584344d5a3082, on base4cf01a49dae20915b1a6939ac7a2d7e53c890a62. Node 24.22.1, Bun 1.4.4, content submodule atbf783ba(git submodule update --init --remote; the submodule pointer is not changed).The review then moved the reading rate from 230 to 235 words a minute (
9fab9bf). That changes only the share image and alt text of "Agent Frameworks for the Rest of Us", now 39 minutes as in the prototype; its checkpoint comment lists what was checked on that commit.bun install, thenbun run build: passes, 62 pages, plus 19 share images,favicon.svg,favicon.icoandapple-touch-icon.png. No[mono]warnings. The share images are 23–43 KB each and the icons under 2 KB.bun run test:documents: 10 tests, 10 passed.tsc --noEmit(strict, the repo's tsconfig): no errors.bun devserves all the new files./articles/<daily-log>/share.pngreturns 404, as it should.og-default.jpgonly.share.pngfiles,favicon.icoandapple-touch-icon.png.<head>, only the favicon links and theog:image/twitter:imagetags change.<body>, the only change is the JSON-LDimageURL on the 58 article and log pages.rss.xml, the sitemap,_redirectsand_headersare unchanged, andllms*.txtdiffer only in their build timestamp./,/about/, an article, an activity log, an unknown URL (the 404) and/documents/are pixel-identical before and after. This issue changes nothing on the pages themselves.docs/redesign/prototype/index.html) has no favicon or share image, so the reference for this unit is the Paper exports above.favicon.svg,favicon.ico(16 and 32) andapple-touch-icon.png.og:imageURL resolves to a 1200×630 PNG.🤖 Generated with Claude Code
https://claude.ai/code/session_013MdjUerTCBDeF5DG9puDd2