Repository navigation
Link previews for the homepage and every reading - #16
Merged
Merged
Conversation
A brown tile with lines of text, right-aligned like Hebrew: one word lit, the rest dimmed, the engine's own highlight. SVG for modern browsers, a 32px PNG fallback, and a full-bleed 180px apple-touch-icon (iOS rounds the corners itself and would fill transparent ones with black). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link-preview crawlers read <meta> from the HTML they fetch and don't run JS, so index.html?sheet=... could only ever preview as one page. Each reading now has a generated share page at read/<slug>/: a copy of index.html with <base href="../../">, data-sheet="<slug>" (the engine reads it when there's no ?sheet=), and its own Open Graph/Twitter tags and 1200x630 image. The homepage's tags live in a generated block in index.html. - scripts/build_previews.py writes the pages and tags; --images re-renders assets/previews/*.jpg: the title, author and description beside the reading's opening text with its first highlight lit. The homepage image uses the hero poster. - The homepage links to read/<slug>/ so copied URLs carry the right preview. ?sheet= links keep working. - test_data: generated pages must match the generator (a ?v= bump without re-running fails) and every image must exist. test_render: every share page loads its reading with no 404s or console errors. - CLAUDE.md, conversion guide and both sheet-building skills say to run it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
📊 Code Quality Score: 49/100
Was this score accurate? 👍 Yes · 👎 No Scored by GitVelocity · How are scores calculated? |
📊 Code Quality Score: 54/100
Was this score accurate? 👍 Yes · 👎 No Scored by GitVelocity · How are scores calculated? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Link-preview crawlers (Slack, iMessage, WhatsApp, social sites) read
<meta>tags from the HTML they fetch and don't run JavaScript, so everyindex.html?sheet=…link previewed as the same page. Now:read/<slug>/. It's a generated copy ofindex.htmlwith<base href="../../">,data-sheet="<slug>"on<html>(the engine reads it when there's no?sheet=; a one-line change), and its own Open Graph/Twitter tags. Deep links work:read/bereshit/?path=creation/cr-1963. Branch clicks and Back keep the/read/…address.assets/previews/. Each shows the title, author and description beside the reading's opening text with its first highlight lit, like the engine does. The homepage image uses the hero poster.read/<slug>/, so copied URLs carry the right preview.?sheet=links keep working but preview as the homepage.Keeping it current
python3 scripts/build_previews.pyregenerates the pages and tags;--images <slug>re-renders an image. Re-run it after anyindex.htmlchange, including?v=bumps.tests/test_data.pyfails while generated pages are stale (verified: a version bump trips it). CLAUDE.md, the conversion guide and both sheet-building skills now include the step.Tests
test_share_pages_are_current: the generated pages match the generator, and every image existstest_share_page_runs_the_reader: everyread/<slug>/loads its reading with no 404s or console errorsread/<slug>/linksBuilt on #15 (favicon). Once that merges, this diff shows only the preview work.
Test plan
tests/test_data.pypasses; homepage and share-page render tests passread/bereshit/?path=creation/cr-1963opens the 1963 leaf; a branch click keeps/read/bereshit/; Back works; tags are absolute URLsread/…link into Slack or opengraph.xyz to confirm the image renders🤖 Generated with Claude Code