From 9d356dacbc7721cdedbb9be01b6a01f0f4e92b30 Mon Sep 17 00:00:00 2001 From: bits-bytes-nn Date: Tue, 13 Oct 2026 18:41:18 +0900 Subject: [PATCH 1/3] Fix lightbox, lint lightbox links, tidy gates and tests - Lightbox: white backdrop for transparent figures, an accessible focus ring on a black band, unpadded black buttons with disabled arrows still dimmed, a dark caption band on phones, focus on close when it opens, a Tab trap that skips off-screen arrows (also on resize), focus back to the figure on close (the handler was never registered: .on() does not chain), aria-modal and a label. - lint-posts.rb: a hand-written glightbox link must open its own image; skip what Jekyll skips (special and backup files); shared slug helper. - validate-site.sh: Disallow check kept, claims narrowed; escaped; Copy buttons hidden in print; tests for untested branches; the comment test now fails when the comment pass is removed. --- .github/workflows/jekyll.yml | 4 ++-- README.ko.md | 2 ++ README.md | 2 ++ _includes/head.html | 2 +- _sass/_layout.scss | 1 + _sass/_post.scss | 36 ++++++++++++++++++++++++++++- docs/tech-doc.md | 4 ++-- js/main.js | 43 +++++++++++++++++++++++++++++++++-- script/lint-posts.rb | 40 +++++++++++++++++++++++++++----- script/validate-site.sh | 5 ++-- test/test_image_dimensions.rb | 1 + test/test_lint_posts.rb | 23 +++++++++++++++++++ test/test_post_description.rb | 4 ++++ test/test_search_index.rb | 8 +++---- 14 files changed, 153 insertions(+), 22 deletions(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index 0cb1449..ec68cdf 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -48,7 +48,7 @@ jobs: # together. If this assumption is ever wrong the build job fails and # `deploy` (needs: build) publishes nothing. - name: Setup Ruby - uses: ruby/setup-ruby@e81a8fa391b11a595c1b7ed84177cc0fe02faf83 # v1 + uses: ruby/setup-ruby@e81a8fa391b11a595c1b7ed84177cc0fe02faf83 # v1.328.0 # The version comes from .ruby-version (3.3+: html-proofer's # async→console dependency requires Ruby >= 3.3). with: @@ -89,7 +89,7 @@ jobs: # parse, that every page carries a description and a canonical, that no # two pages share a description or title, and that each plugin hook left # its mark on the posts (script/check-plugin-output.rb). Each check maps - # to a defect this site actually shipped. + # to a defect that shipped here or would ship silently. run: script/validate-site.sh ./_site - name: Upload artifact # Nothing to publish from a PR run; the gates above are the whole point. diff --git a/README.ko.md b/README.ko.md index 16c5d23..01b38d3 100644 --- a/README.ko.md +++ b/README.ko.md @@ -225,6 +225,8 @@ kramdown이 내용을 그대로 보존해 `\(…\)`로 내보내므로 안전합 디스플레이 `$$` 줄. - 마커 뒤에 언어 말고 다른 것이 붙은 코드 펜스, 닫히지 않은 펜스. - 게시일로 시작하지 않는 파일명, 그보다 늦은 `date:`. +- `href`가 이미지 `src`와 다른 직접 쓴 `<a class="glightbox">`: 라이트박스가 그 페이지를 + iframe으로 열고 사이트가 이를 거부합니다. 출처는 캡션에 적습니다. - ar5iv 링크: ar5iv는 잃어버린 그림 대신 대체 이미지를 HTTP 200으로 돌려줍니다. `arxiv.org/html/<id>v1/…`를 쓰거나 그림을 `assets/images/`에 복사합니다. diff --git a/README.md b/README.md index bccc3bf..71c5980 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,8 @@ rules easiest to trip, each a page that renders wrong with every other gate gree a display `$$` line without blank lines around it. - a code fence with more than a language after the marker, or one never closed. - a file name that does not start with the posting day, or a `date:` after it. +- a hand-written `<a class="glightbox">` whose `href` is not its image's `src`: the + lightbox loads the page in an iframe the site refuses. Credit the source in the caption. - an ar5iv link: ar5iv now answers a lost figure with a placeholder image and HTTP 200. Use `arxiv.org/html/<id>v1/…`, or copy the figure into `assets/images/`. diff --git a/_includes/head.html b/_includes/head.html index 3b8968c..34387bc 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -83,7 +83,7 @@ })(); </script> - <title>{{ html_title }} + {{ html_title | escape }} {% if site.author %} diff --git a/_sass/_layout.scss b/_sass/_layout.scss index 97281c3..f5e2999 100644 --- a/_sass/_layout.scss +++ b/_sass/_layout.scss @@ -895,6 +895,7 @@ blockquote { .share, .post-nav, .related-posts, + .code-copy, .site-footer { display: none !important; } diff --git a/_sass/_post.scss b/_sass/_post.scss index 191628b..cb007d2 100644 --- a/_sass/_post.scss +++ b/_sass/_post.scss @@ -395,4 +395,38 @@ line-height: 1.4; } } -} \ No newline at end of file +} + +// The lightbox (GLightbox's sheet loads after this one). A figure with a +// transparent background gets the white paper it was drawn on here too; the +// focus ring is the site's light blue on the black overlay (GLightbox's +// #0f3d81 reaches 1.8:1); the buttons are opaque over a wide white figure and +// drop the padding every