diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-21 09:45:21 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-21 09:45:21 +0300 |
| commit | ed549aaa423f10d15171c678303fea679d997220 (patch) | |
| tree | 811ec27c8393cdb2ddf38411997988b1f075f491 /bin | |
| parent | 6e6cc0b44fce859669bd967c5d98a39074d8251c (diff) | |
Fix W3C HTML validation errors in generated pages; release 0.10.10.10.1
Every shuriken-generated page failed W3C validation. Fixed across the
templates and the bash thumbnail builders so all page categories (splash,
gallery, photo view, details, stats overview, stats filter mini-albums and
redirect stubs) validate cleanly:
- Add <!DOCTYPE html>, <html lang="en"> and <meta charset="utf-8"> to the
header, splash and redirect templates.
- Drop the obsolete type="text/css" on <style> and border='0' on <img>.
- Fix invalid CSS "margin: 2 auto" -> "margin: 2px auto".
- Add required alt attributes to every <img> (splash, thumbnails, views).
- Replace the obsolete name attribute on <a> thumbnail anchors with id (in
album-render.source.sh and stats-filter-album.source.sh, where the markup
is actually built, plus preview.tmpl for consistency).
- Give redirect stubs a <title>; drop trailing slashes on void elements.
Updated the affected cli.sh assertions and rebuilt bin/shuriken.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/shuriken | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/bin/shuriken b/bin/shuriken index 144b4b9..2cd6c8b 100755 --- a/bin/shuriken +++ b/bin/shuriken @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -# shuriken (c) 2011 - 2014, 2022 by Paul Buetow +# shuriken (c) 2011 - 2014, 2022, 2025, 2026 by Paul Buetow # https://codeberg.org/snonux/shuriken.sh if (( BASH_VERSINFO[0] < 5 \ @@ -10,7 +10,7 @@ if (( BASH_VERSINFO[0] < 5 \ exit 1 fi -declare -r VERSION='0.10.0' +declare -r VERSION='0.10.1' declare -r DEFAULTRC="${SHURIKEN_DEFAULT_RC:-/etc/default/shuriken}" declare -r PACKAGED_TEMPLATE_DIR='/usr/share/shuriken/templates/default' declare -r PACKAGED_ASSET_DIR='/usr/share/shuriken/assets' @@ -2608,9 +2608,9 @@ queue_preview_page_render_job() { } # Append one thumbnail's markup to a page's accumulating thumbnail-grid buffer. -# Produces exactly the bytes the old per-thumbnail preview.tmpl emitted (the -# <a name=... href=...><img class='thumb <anim>' .../></a> block), so batching -# all thumbnails into one previewpage render stays byte-identical. Every +# Produces the per-thumbnail preview.tmpl block (the +# <a id=... href=...><img class='thumb <anim>' alt=... src=...></a> block), so +# batching all thumbnails into one previewpage render stays consistent. Every # interpolated value is HTML-escaped like the template's context_html fields; the # seeded "slow" animation class is preserved exactly. Blocks are separated by a # newline; the previewpage template adds the single trailing newline, matching @@ -2655,10 +2655,10 @@ build_preview_thumbnail() { anim_html=$(_html_escape "$animation_class") backhref_html=$(_html_escape "$backhref") thumbs_dir_html=$(_html_escape "$thumbs_dir") - printf '<a name=%s href=%s>\n' \ + printf '<a id=%s href=%s>\n' \ "'$photo_html'" "'$page_num-$preview_num.html'" - printf " <img class='thumb %s' src='%s/%s/%s' />\n</a>" \ - "$anim_html" "$backhref_html" "$thumbs_dir_html" "$photo_html" + printf " <img class='thumb %s' alt='%s' src='%s/%s/%s'>\n</a>" \ + "$anim_html" "$photo_html" "$backhref_html" "$thumbs_dir_html" "$photo_html" } render_view_page() { @@ -4453,9 +4453,9 @@ _stats_filter_thumbnail() { animation_class=$(random_animation_css_class slow "$photo") # The view page sits in the same directory as this gallery, so link to it by # bare index; the thumbnail image lives at the album root via backhref. - printf ' <a name="%s" href="%d.html">' "$photo_html" "$index" - printf '<img class="thumb %s" src="%s/%s/%s" /></a>\n' \ - "$animation_class" "$backhref_html" "$STATS_THUMBS_DIR" "$photo_html" + printf ' <a id="%s" href="%d.html">' "$photo_html" "$index" + printf '<img class="thumb %s" alt="%s" src="%s/%s/%s"></a>\n' \ + "$animation_class" "$photo_html" "$backhref_html" "$STATS_THUMBS_DIR" "$photo_html" } # Build the full thumbnail grid for one filter from its newline-separated photo |
