Commit notifications for all Sup repositories
 help / color / mirror / Atom feed
* [sup-website.git] branch master updated (78e88eb -> 1238c53)
@ 2026-10-21 10:06 Dan Callaghan
  2026-10-21 10:06 ` [sup-website.git] 01/02: update screenshots after running oxipng -o 2 Dan Callaghan
  2026-10-21 10:06 ` [sup-website.git] 02/02: responsive screenshots with optimised half and quarter size versions Dan Callaghan
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Callaghan @ 2026-10-21 10:06 UTC (permalink / raw)
  To: sup-commits

Pushed branch master:
    from 78e88eb  page speed improvements for web fonts
     new 4d47db3  update screenshots after running oxipng -o 2
     new 1238c53  responsive screenshots with optimised half and quarter size versions


Summary of changes:
 _plugins/responsive_images.rb      |  75 +++++++++++++++++++++++++++++++++++++
 index.md                           |   2 +-
 screenshots/1.4/console.png        | Bin 74239 -> 53354 bytes
 screenshots/1.4/help.png           | Bin 113591 -> 80297 bytes
 screenshots/1.4/inbox.png          | Bin 411327 -> 294614 bytes
 screenshots/1.4/log.png            | Bin 224862 -> 155983 bytes
 screenshots/1.4/reply.png          | Bin 150124 -> 104157 bytes
 screenshots/1.4/search-results.png | Bin 431355 -> 304333 bytes
 screenshots/1.4/thread-view.png    | Bin 158395 -> 112667 bytes
 screenshots/index.md               |  14 +++----
 10 files changed, 83 insertions(+), 8 deletions(-)
 create mode 100644 _plugins/responsive_images.rb

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [sup-website.git] 01/02: update screenshots after running oxipng -o 2
  2026-10-21 10:06 [sup-website.git] branch master updated (78e88eb -> 1238c53) Dan Callaghan
@ 2026-10-21 10:06 ` Dan Callaghan
  2026-10-21 10:06 ` [sup-website.git] 02/02: responsive screenshots with optimised half and quarter size versions Dan Callaghan
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Callaghan @ 2026-10-21 10:06 UTC (permalink / raw)
  To: sup-commits

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

commit 4d47db3f52dca188b53c6d1caffc12e99eaf7905
Author: Dan Callaghan <djc@djc.id.au>
AuthorDate: Wed Oct 21 20:59:07 2026 +1100

    update screenshots after running oxipng -o 2
---
 screenshots/1.4/console.png        | Bin 74239 -> 53354 bytes
 screenshots/1.4/help.png           | Bin 113591 -> 80297 bytes
 screenshots/1.4/inbox.png          | Bin 411327 -> 294614 bytes
 screenshots/1.4/log.png            | Bin 224862 -> 155983 bytes
 screenshots/1.4/reply.png          | Bin 150124 -> 104157 bytes
 screenshots/1.4/search-results.png | Bin 431355 -> 304333 bytes
 screenshots/1.4/thread-view.png    | Bin 158395 -> 112667 bytes
 7 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/screenshots/1.4/console.png b/screenshots/1.4/console.png
index 0627f53..75fc742 100644
Binary files a/screenshots/1.4/console.png and b/screenshots/1.4/console.png differ
diff --git a/screenshots/1.4/help.png b/screenshots/1.4/help.png
index 4318da6..e3d776f 100644
Binary files a/screenshots/1.4/help.png and b/screenshots/1.4/help.png differ
diff --git a/screenshots/1.4/inbox.png b/screenshots/1.4/inbox.png
index 085e0fb..3fe34e1 100644
Binary files a/screenshots/1.4/inbox.png and b/screenshots/1.4/inbox.png differ
diff --git a/screenshots/1.4/log.png b/screenshots/1.4/log.png
index 8b12664..46009fc 100644
Binary files a/screenshots/1.4/log.png and b/screenshots/1.4/log.png differ
diff --git a/screenshots/1.4/reply.png b/screenshots/1.4/reply.png
index a60c689..8a0013d 100644
Binary files a/screenshots/1.4/reply.png and b/screenshots/1.4/reply.png differ
diff --git a/screenshots/1.4/search-results.png b/screenshots/1.4/search-results.png
index f7cc743..22cfc9a 100644
Binary files a/screenshots/1.4/search-results.png and b/screenshots/1.4/search-results.png differ
diff --git a/screenshots/1.4/thread-view.png b/screenshots/1.4/thread-view.png
index bc9185e..2227194 100644
Binary files a/screenshots/1.4/thread-view.png and b/screenshots/1.4/thread-view.png differ

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [sup-website.git] 02/02: responsive screenshots with optimised half and quarter size versions
  2026-10-21 10:06 [sup-website.git] branch master updated (78e88eb -> 1238c53) Dan Callaghan
  2026-10-21 10:06 ` [sup-website.git] 01/02: update screenshots after running oxipng -o 2 Dan Callaghan
@ 2026-10-21 10:06 ` Dan Callaghan
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Callaghan @ 2026-10-21 10:06 UTC (permalink / raw)
  To: sup-commits

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

commit 1238c539ae7734ea55e2602f31285f5a467a8c0a
Author: Dan Callaghan <djc@djc.id.au>
AuthorDate: Wed Oct 21 21:00:32 2026 +1100

    responsive screenshots with optimised half and quarter size versions
---
 _plugins/responsive_images.rb | 75 +++++++++++++++++++++++++++++++++++++++++++
 index.md                      |  2 +-
 screenshots/index.md          | 14 ++++----
 3 files changed, 83 insertions(+), 8 deletions(-)

diff --git a/_plugins/responsive_images.rb b/_plugins/responsive_images.rb
new file mode 100644
index 0000000..94410ea
--- /dev/null
+++ b/_plugins/responsive_images.rb
@@ -0,0 +1,75 @@
+require 'open3'
+
+def run_command *args
+  out, err, status = Open3.capture3 *args
+  raise "#{args.first} failed: #{err}" unless status.success?
+  out
+end
+
+class ResizedImage < Jekyll::StaticFile
+  def initialize site, dir, name, source, width
+    super site, site.source, dir, name
+    @source = source
+    @width = width
+  end
+
+  def path
+    @source
+  end
+
+  def write dest
+    dest_path = destination dest
+    Jekyll.logger.info "Resizing:", dest_path
+    FileUtils.mkdir_p File.dirname(dest_path)
+    run_command "magick", @source, "-resize", "#{@width}x", dest_path
+    run_command "pngquant", "--nofs", "--strip", "--force", "--output", dest_path, "32", dest_path
+    run_command "oxipng", "--quiet", "--opt", "2", "--strip", "all", dest_path
+    true
+  end
+end
+
+$responsive_images = {}
+Jekyll::Hooks.register :site, :after_reset do |site|
+  $responsive_images = {}
+end
+
+class ResponsiveImageTag < Liquid::Tag
+  def initialize tag_name, markup, tokens
+    super
+    @src, *options = markup.split
+    @lazy = options.include? "lazy"
+  end
+
+  def render context
+    site = context.registers[:site]
+    page = context.registers[:page]
+    site_path = @src.start_with?("/") ? @src : File.join(page["dir"], @src)
+    image = $responsive_images[site_path] ||= add_image site, site_path
+
+    ext = File.extname @src
+    base = @src.delete_suffix ext
+    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"))
+    "<img #{attrs}>"
+  end
+
+  private
+
+  def add_image site, site_path
+    source = File.join site.source, site_path
+    raise "responsive_img: #{source} not found" unless File.exist? source
+    width, height = run_command("magick", "identify", "-format", "%w %h", source).split.map(&:to_i)
+    dir = File.dirname site_path
+    ext = File.extname site_path
+    basename = File.basename site_path, ext
+    widths = [2, 4].map { |d| width / d }
+    widths.each do |w|
+      site.static_files << ResizedImage.new(site, dir, "#{basename}-#{w}w#{ext}", source, w)
+    end
+    { width: width, height: height, widths: widths }
+  end
+end
+
+Liquid::Template.register_tag("responsive_img", ResponsiveImageTag)
diff --git a/index.md b/index.md
index 0b6a592..86b3ff7 100644
--- a/index.md
+++ b/index.md
@@ -9,7 +9,7 @@ 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"><img src="screenshots/1.4/inbox.png" width="1920" height="1148"></a>
+<a href="screenshots/1.4/inbox.png">{% responsive_img screenshots/1.4/inbox.png %}</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 a03761b..c638389 100644
--- a/screenshots/index.md
+++ b/screenshots/index.md
@@ -3,45 +3,45 @@ title: sup screenshots
 layout: gallery
 ---
 <figure>
-  <a href="1.4/inbox.png"><img src="1.4/inbox.png" width="1920" height="1148"></a>
+  <a href="1.4/inbox.png">{% responsive_img 1.4/inbox.png lazy %}</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"><img src="1.4/search-results.png" width="1920" height="1148"></a>
+  <a href="1.4/search-results.png">{% responsive_img 1.4/search-results.png lazy %}</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"><img src="1.4/thread-view.png" width="1920" height="1148"></a>
+  <a href="1.4/thread-view.png">{% responsive_img 1.4/thread-view.png lazy %}</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"><img src="1.4/reply.png" width="1920" height="1148"></a>
+  <a href="1.4/reply.png">{% responsive_img 1.4/reply.png lazy %}</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"><img src="1.4/help.png" width="1920" height="1148"></a>
+  <a href="1.4/help.png">{% responsive_img 1.4/help.png lazy %}</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"><img src="1.4/log.png" width="1920" height="1148"></a>
+  <a href="1.4/log.png">{% responsive_img 1.4/log.png lazy %}</a>
   <figcaption>
     The log-mode buffer shows Sup’s internal log messages for debugging purposes.
   </figcaption>
 </figure>
 <figure>
-  <a href="1.4/console.png"><img src="1.4/console.png" width="1920" height="1148"></a>
+  <a href="1.4/console.png">{% responsive_img 1.4/console.png lazy %}</a>
   <figcaption>
     Sup has a built-in interactive Ruby console.
     It can access Sup internal Ruby objects.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-21 10:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 10:06 [sup-website.git] branch master updated (78e88eb -> 1238c53) Dan Callaghan
2026-10-21 10:06 ` [sup-website.git] 01/02: update screenshots after running oxipng -o 2 Dan Callaghan
2026-10-21 10:06 ` [sup-website.git] 02/02: responsive screenshots with optimised half and quarter size versions Dan Callaghan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox