From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by bl2.djc.id.au (Postfix, from userid 1000) id 47AF02D4D96; Sun, 29 Nov 2026 15:52:45 +1100 (AEDT) Date: Sun, 29 Nov 2026 15:52:45 +1100 To: sup-commits@supmua.dev Subject: [sup-website.git] branch master updated: add the favicon to stagit output as well MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <179592796518.310993.11381862325220803876@bl2.djc.id.au> Reply-To: Dan Callaghan 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-Oldrev: cb0c9209f0f1d22be4565fdbca91ef8ff0698007 X-Git-Newrev: 1861a0817231bc3a3c54aad8f500ed9b6b6cb7e8 X-Git-Rev: 1861a0817231bc3a3c54aad8f500ed9b6b6cb7e8 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.7.dev Auto-Submitted: auto-generated From: Dan Callaghan List-Id: Pushed a commit to branch master: https://supmua.dev/git/sup-website/commit/1861a0817231bc3a3c54aad8f500ed9b6b6cb7e8.html The following commit(s) were added to refs/heads/master by this push: new 1861a08 add the favicon to stagit output as well 1861a08 is described below commit 1861a0817231bc3a3c54aad8f500ed9b6b6cb7e8 Author: Dan Callaghan AuthorDate: Sun Nov 29 15:52:26 2026 +1100 add the favicon to stagit output as well I forgot that it doesn't use the shared Jekyll layout. --- _plugins/stagit.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/_plugins/stagit.rb b/_plugins/stagit.rb index f508d90..5466b76 100644 --- a/_plugins/stagit.rb +++ b/_plugins/stagit.rb @@ -26,11 +26,23 @@ def wrap_stagit_output path, header body.children.remove body << header << nav_section << main_section - ## Fix the stylesheet and add dummy favion like _layouts/default.md + ## Fix the stylesheet and add favicons like _layouts/default.md stylesheet = doc.at_css('link[rel="stylesheet"]') stylesheet["href"] = "/stylesheets/stylesheet.css" stylesheet["media"] = "screen" - doc.at("head").add_child '' + [48, 32, 16].each do |size| + link = doc.create_element "link" + link["rel"] = "icon" + link["type"] = "image/png" + link["sizes"] = "#{size}x#{size}" + link["href"] = "/images/favicon-dark-#{size}.png" + link["media"] = "(prefers-color-scheme: dark)" + doc.at("head").add_child link + link = link.clone + link["href"] = "/images/favicon-#{size}.png" + link["media"] = "(prefers-color-scheme: light)" + doc.at("head").add_child link + end ## Add some nicer markup in commit messages doc.xpath("//pre[b[normalize-space()='commit' and not(preceding-sibling::node())]]//text()").each do |text_node|