From 568039a39b416d3f8c8ad315c1af6dacadf3e6a9 Mon Sep 17 00:00:00 2001 From: luxick Date: Fri, 10 Apr 2026 12:26:34 +0200 Subject: [PATCH] Display favicons for external links --- assets/content.js | 12 ++++++++++++ assets/page.html | 1 + 2 files changed, 13 insertions(+) create mode 100644 assets/content.js diff --git a/assets/content.js b/assets/content.js new file mode 100644 index 0000000..1efe686 --- /dev/null +++ b/assets/content.js @@ -0,0 +1,12 @@ +(function () { + document.querySelectorAll('.content a[href^="http"]').forEach(function (a) { + var hostname = new URL(a.href).hostname; + var img = document.createElement('img'); + img.src = 'https://icons.duckduckgo.com/ip3/' + hostname + '.ico'; + img.width = 16; + img.height = 16; + img.style.verticalAlign = 'middle'; + img.style.marginRight = '3px'; + a.prepend(img); + }); +})(); diff --git a/assets/page.html b/assets/page.html index 7f54f9f..2f0056b 100644 --- a/assets/page.html +++ b/assets/page.html @@ -47,6 +47,7 @@ {{else}} {{if .Content}}
{{.Content}}
+ {{end}} {{if .Entries}}
Contents