Nest handout R2 assets under handouts/<slug>/#94
Merged
Conversation
…are one set Previously every image and PDF was uploaded once per language: angle-basics-1.cs-1.svg, angle-basics-1.sk-1.svg, angle-basics-1.en-1.svg — three byte-identical copies of one SVG. PDFs lived under handouts/pdfs/, images under handouts/images/, with the language code and a counter baked into each filename. Both kinds of artefact now live under handouts/<slug>/<file>, where <slug> is the language-stripped handout id (the .tex file stem, matching the English slug in handouts.json). All three language versions of factorization point at the same factorization/box.svg, factorization/ag-proof.svg, and the main + skeleton PDFs join them in the same folder. ImageProcessingConfig swaps FileNamePrefix for an OutputFileName delegate so each caller picks its own naming scheme; problem images keep their <slug>-<N>.svg shape unchanged. The handouts CLI derives the slug + R2 key via two small helpers (ToHandoutSlug, ToHandoutR2Key) shared between the image and PDF paths. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PatrikBak
added a commit
that referenced
this pull request
May 13, 2026
External references to handout PDFs use the old /pdfs/ URLs, so the nested-by-slug layout from PR #94 broke those links. Restore the flat handouts/pdfs/<file>.pdf layout for PDFs. Images stay nested under handouts/<slug>/ since they're only referenced from our own handout JSON. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
angle-basics-1.cs-1.svg,.sk-1.svg,.en-1.svg— three identical copies). Now both artefact kinds live underhandouts/<slug>/<file>, language-neutral, where<slug>is the language-stripped handout id (the.texfile stem, matching the English slug inhandouts.json).ImageProcessingConfigswapsFileNamePrefixfor anOutputFileName: (imageId, counter) -> stringdelegate so each caller picks its own scheme. Problem images keep their<slug>-<N>.svgshape unchanged; handout images use the source SVG's natural name (angles-vertical.svg).UploadHandoutPdfAsync(wasUploadPdfToR2Async); the slug-derivation regex and thehandouts/R2 prefix live in single helpers (ToHandoutSlug,ToHandoutR2Key) shared by the image and PDF paths.getProblemImageUrl('handouts', ...)drops the/images/segment;getHandoutPdfUrlderives the slug from the filename to buildhandouts/<slug>/<file>.pdf. All 6 image-bearing handout JSONs regenerated — their three language variants now share an identicalcontentIdset.