Commit notifications for all Sup repositories
 help / color / mirror / Atom feed
* [sup-website.git] branch master updated: add the favicon to stagit output as well
@ 2026-11-29  4:52 Dan Callaghan
  0 siblings, 0 replies; only message in thread
From: Dan Callaghan @ 2026-11-29  4:52 UTC (permalink / raw)
  To: sup-commits

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 <djc@djc.id.au>
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 '<link rel="icon" href="data:image/png;base64,iVBORw0KGgo=">'
+  [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|

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-29  4:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29  4:52 [sup-website.git] branch master updated: add the favicon to stagit output as well Dan Callaghan

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