Commit notifications for all Sup repositories
 help / color / mirror / Atom feed
From: Dan Callaghan <dan@bl2.djc.id.au>
To: sup-commits@supmua.dev
Subject: [sup-website.git] 03/04: add rudimentary alt text to screenshots
Date: Sat, 31 Oct 2026 13:39:56 +1100	[thread overview]
Message-ID: <20261031023953.5AB312B149E@bl2.djc.id.au> (raw)
In-Reply-To: <179341439302.57629.134319127016661964@bl2.djc.id.au>

New commit on branch master:
https://supmua.dev/git/sup-website/commit/9b27813b5b455a4b64198baf8534ddfca9fc72ad.html

commit 9b27813b5b455a4b64198baf8534ddfca9fc72ad
Author: Dan Callaghan <djc@djc.id.au>
AuthorDate: Sat Oct 31 11:50:06 2026 +1100

    add rudimentary alt text to screenshots
---
 _plugins/responsive_images.rb | 12 +++++++++---
 index.md                      |  4 +++-
 screenshots/index.md          | 28 +++++++++++++++++++++-------
 3 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/_plugins/responsive_images.rb b/_plugins/responsive_images.rb
index 94410ea..7114d90 100644
--- a/_plugins/responsive_images.rb
+++ b/_plugins/responsive_images.rb
@@ -1,3 +1,4 @@
+require 'cgi'
 require 'open3'
 
 def run_command *args
@@ -36,8 +37,11 @@ end
 class ResponsiveImageTag < Liquid::Tag
   def initialize tag_name, markup, tokens
     super
-    @src, *options = markup.split
-    @lazy = options.include? "lazy"
+    @src = markup.split.first
+    @attributes = {}
+    markup.scan(Liquid::TagAttributes) do |key, value|
+      @attributes[key] = Liquid::Expression.parse value
+    end
   end
 
   def render context
@@ -51,7 +55,9 @@ class ResponsiveImageTag < Liquid::Tag
     srcset = image[:widths].map { |w| "#{base}-#{w}w#{ext} #{w}w" }
     srcset << "#{@src} #{image[:width]}w"
     attrs = %(src="#{@src}" width="#{image[:width]}" height="#{image[:height]}" srcset="#{srcset.join(", ")}")
-    attrs << (@lazy ? %( loading="lazy" sizes="auto, 100vw") : %( sizes="100vw"))
+    alt = context.evaluate @attributes["alt"]
+    attrs << %( alt="#{CGI.escapeHTML alt.to_s}") unless alt.nil?
+    attrs << (context.evaluate(@attributes["lazy"]) ? %( loading="lazy" sizes="auto, 100vw") : %( sizes="100vw"))
     "<img #{attrs}>"
   end
 
diff --git a/index.md b/index.md
index 86b3ff7..644cad3 100644
--- a/index.md
+++ b/index.md
@@ -9,7 +9,9 @@ It supports a very fast full-text search, automatic contact-list management, cus
 
 If you're the type of person who treats email as an extension of your long-term memory, Sup is for you.
 
-<a href="screenshots/1.4/inbox.png">{% responsive_img screenshots/1.4/inbox.png %}</a>
+<a href="screenshots/1.4/inbox.png">
+  {% responsive_img screenshots/1.4/inbox.png alt: "Screenshot of Sup’s inbox-mode, showing a list of email threads." %}
+</a>
 
 ## Installation
 Install the sup rubygem and run the sup-config utility to build a configuration:
diff --git a/screenshots/index.md b/screenshots/index.md
index c638389..1ca77c5 100644
--- a/screenshots/index.md
+++ b/screenshots/index.md
@@ -3,45 +3,59 @@ title: sup screenshots
 layout: gallery
 ---
 <figure>
-  <a href="1.4/inbox.png">{% responsive_img 1.4/inbox.png lazy %}</a>
+  <a href="1.4/inbox.png">
+    {% responsive_img 1.4/inbox.png alt: "Screenshot of Sup’s inbox-mode, showing a list of email threads." lazy: true %}
+  </a>
   <figcaption>
     Sup starts in inbox-mode: a list of threads tagged <tt class="code">inbox</tt>.
   </figcaption>
 </figure>
 <figure>
-  <a href="1.4/search-results.png">{% responsive_img 1.4/search-results.png lazy %}</a>
+  <a href="1.4/search-results.png">
+    {% responsive_img 1.4/search-results.png alt: "Screenshot of Sup’s search-results-mode, showing a list of email threads matching a search query for “maildir”." lazy: true %}
+  </a>
   <figcaption>
     <a href="https://github.com/sup-heliotrope/sup/wiki/Searching-Your-Mail">Search your mail</a>
     and Sup displays a list of matching threads in search-results-mode.
   </figcaption>
 </figure>
 <figure>
-  <a href="1.4/thread-view.png">{% responsive_img 1.4/thread-view.png lazy %}</a>
+  <a href="1.4/thread-view.png">
+    {% responsive_img 1.4/thread-view.png alt: "Screenshot of Sup’s thread-view-mode, showing a hierarchy of email messages." lazy: true %}
+  </a>
   <figcaption>
     In thread-view-mode, read messages are collapsed to a single line by default.
   </figcaption>
 </figure>
 <figure>
-  <a href="1.4/reply.png">{% responsive_img 1.4/reply.png lazy %}</a>
+  <a href="1.4/reply.png">
+    {% responsive_img 1.4/reply.png alt: "Screenshot of Sup’s reply-mode, showing email headers and a quoted reply as the body." lazy: true %}
+  </a>
   <figcaption>
     When replying to a message, reply-mode is pre-populated with quoted text.
     Press <tt class="code">Enter</tt> to edit the reply in your preferred editor.
   </figcaption>
 </figure>
 <figure>
-  <a href="1.4/help.png">{% responsive_img 1.4/help.png lazy %}</a>
+  <a href="1.4/help.png">
+    {% responsive_img 1.4/help.png alt: "Screenshot of Sup’s help-mode, showing a list of key bindings." lazy: true %}
+  </a>
   <figcaption>
     Press <tt class="code">?</tt> in any mode to see the key bindings for the current mode.
   </figcaption>
 </figure>
 <figure>
-  <a href="1.4/log.png">{% responsive_img 1.4/log.png lazy %}</a>
+  <a href="1.4/log.png">
+    {% responsive_img 1.4/log.png alt: "Screenshot of Sup’s log-mode, showing debug log messages produced by Sup." lazy: true %}
+  </a>
   <figcaption>
     The log-mode buffer shows Sup’s internal log messages for debugging purposes.
   </figcaption>
 </figure>
 <figure>
-  <a href="1.4/console.png">{% responsive_img 1.4/console.png lazy %}</a>
+  <a href="1.4/console.png">
+    {% responsive_img 1.4/console.png alt: "Screenshot of Sup’s console-mode, showing a Ruby REPL which has evaluated some Ruby expressions." lazy: true %}
+  </a>
   <figcaption>
     Sup has a built-in interactive Ruby console.
     It can access Sup internal Ruby objects.

  parent reply	other threads:[~2026-10-31  2:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  2:39 [sup-website.git] branch master updated (1238c53 -> ee75780) Dan Callaghan
2026-10-31  2:39 ` [sup-website.git] 01/04: make hashes line up on the releases page Dan Callaghan
2026-10-31  2:39 ` [sup-website.git] 02/04: apply the same stylistic variants to monospace as in proportional Dan Callaghan
2026-10-31  2:39 ` Dan Callaghan [this message]
2026-10-31  2:39 ` [sup-website.git] 04/04: use <kbd> element for keys Dan Callaghan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261031023953.5AB312B149E@bl2.djc.id.au \
    --to=dan@bl2.djc.id.au \
    --cc=djc@djc.id.au \
    --cc=sup-commits@supmua.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox