From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by bl2.djc.id.au (Postfix, from userid 1000) id 5AB312B149E; Sat, 31 Oct 2026 13:39:53 +1100 (AEDT) Date: Sat, 31 Oct 2026 13:39:56 +1100 To: sup-commits@supmua.dev Subject: [sup-website.git] 03/04: add rudimentary alt text to screenshots MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Reply-To: Dan Callaghan In-Reply-To: <179341439302.57629.134319127016661964@bl2.djc.id.au> References: <179341439302.57629.134319127016661964@bl2.djc.id.au> Thread-Index: AQAAEjRWxemtAJUUTtu5TEYrq7yJQg== X-Git-Host: bl2.djc.id.au X-Git-Repo: sup-website.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 9b27813b5b455a4b64198baf8534ddfca9fc72ad X-Git-NotificationType: diff X-Git-Multimail-Version: 1.7.dev Auto-Submitted: auto-generated Message-Id: <20261031023953.5AB312B149E@bl2.djc.id.au> From: Dan Callaghan List-Id: New commit on branch master: https://supmua.dev/git/sup-website/commit/9b27813b5b455a4b64198baf8534ddfca9fc72ad.html commit 9b27813b5b455a4b64198baf8534ddfca9fc72ad Author: Dan Callaghan 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")) "" 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. -{% responsive_img 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." %} + ## 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 ---
- {% responsive_img 1.4/inbox.png lazy %} + + {% responsive_img 1.4/inbox.png alt: "Screenshot of Sup’s inbox-mode, showing a list of email threads." lazy: true %} +
Sup starts in inbox-mode: a list of threads tagged inbox.
- {% responsive_img 1.4/search-results.png lazy %} + + {% 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 %} +
Search your mail and Sup displays a list of matching threads in search-results-mode.
- {% responsive_img 1.4/thread-view.png lazy %} + + {% responsive_img 1.4/thread-view.png alt: "Screenshot of Sup’s thread-view-mode, showing a hierarchy of email messages." lazy: true %} +
In thread-view-mode, read messages are collapsed to a single line by default.
- {% responsive_img 1.4/reply.png lazy %} + + {% 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 %} +
When replying to a message, reply-mode is pre-populated with quoted text. Press Enter to edit the reply in your preferred editor.
- {% responsive_img 1.4/help.png lazy %} + + {% responsive_img 1.4/help.png alt: "Screenshot of Sup’s help-mode, showing a list of key bindings." lazy: true %} +
Press ? in any mode to see the key bindings for the current mode.
- {% responsive_img 1.4/log.png lazy %} + + {% responsive_img 1.4/log.png alt: "Screenshot of Sup’s log-mode, showing debug log messages produced by Sup." lazy: true %} +
The log-mode buffer shows Sup’s internal log messages for debugging purposes.
- {% responsive_img 1.4/console.png lazy %} + + {% 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 %} +
Sup has a built-in interactive Ruby console. It can access Sup internal Ruby objects.