Repository navigation
feat(share): media-aware generated folder index - #79
Merged
Merged
Conversation
The generated listing was a bare list of links. It now groups rows by folder with a type and a human size, plays videos inline, shows images as a lazy grid with a click-to-enlarge lightbox, and keeps everything else as plain rows. Self-contained, paper theme, light and dark, escaped labels and encoded hrefs.
preload=metadata alone drew a blank box. The video src now ends in #t=0.1; the Download link and the name link keep the plain path.
ls prints du of the whole pub/<id>, and the media-aware index.html is larger by design. The row normalizes size= in both listings and still diffs every other artifact.
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.
What
The generated folder index is now media-aware, for both the tunnel and the R2 backends (
gen_indexruns fromstage_copy)..mdis still listed by its.html.mp4 mov m4v webm: inline<video controls playsinline preload="metadata">plus a download link.png jpg jpeg gif webp avif svg: responsive grid of lazy, async<img>on the originals, with a lightbox (click, Esc, arrow keys, swipe, link to the full file; fits the viewport, covers the page on phones).write_md_style, light and dark, readable at 400 px. Inline CSS and script, nothing external.Unchanged: own
index.htmlorREADME.htmlwins,--no-index, dotfiles and symlinks never ship, line 1 keeps<title>index</title>fortype_of.Safety
Every label goes through
html_esc, every href and src throughurlenc. A name with a control character is served but not listed.Verification
SHARE_TEST_ONLY='folder index' bash tests/share.sh: core group, 586 checks, PASS; 38folder indexrows, new ones cover mixed media, text-only, own index,--no-index, hostile names.<escape turns the three hostile-name rows red.shellcheck bin/share tests/share.shclean; parses and runs under macOS/bin/bash3.2; GNU and BSDstatgive the same page.Spec:
docs/specs/SPEC-011-media-folder-index.md. Proof:docs/verification/media-folder-index.md.Not covered: Cloudflare tunnel and R2 serving paths (one shared call, exercised through the local server); video seeking over R2 depends on the Worker's range handling, untouched here.