commit 562f7ee53789612126e6c7f48d7746f741df280a equwal <13551856+equwal@users.noreply.github.com> 2026-09-25 01:17:44 -0700 Show the links without script Include the list from sbm-webpublish with nginx SSI. It replaces the script that read links.json. Link to the Atom feed and to the plain text. Put an Atom alternate link in the head of each page that sets feed, so that feed readers and sfeed_web find the feed.
build.sh | 3 +++ pages/links.md | 49 ++++++++----------------------------------------- 2 files changed, 11 insertions(+), 41 deletions(-)
diff --git a/build.sh b/build.sh index b1f9586..79d663d 100755 --- a/build.sh +++ b/build.sh @@ -49,6 +49,9 @@ cat > "$TEMPLATE" << 'TMPL' <meta name="twitter:card" content="summary_large_image" /> <link rel="stylesheet" href="style.css" /> <link rel="alternate" type="application/rss+xml" title="Recently Written" href="rss.xml" /> +$if(feed)$ + <link rel="alternate" type="application/atom+xml" title="$title$" href="$feed$" /> +$endif$ </head> <body> <div id="container"> diff --git a/pages/links.md b/pages/links.md index 23a5218..cc3e5ef 100644 --- a/pages/links.md +++ b/pages/links.md @@ -1,47 +1,14 @@ --- title: Links +feed: links/atom.xml --- -Pages that I keep. The newest are first. The list comes from -[sbm-webpublish](https://github.com/equwal/sbm-webpublish). +Pages that I keep, under their tags. The newest are first. The list comes +from [sbm-webpublish](https://github.com/equwal/sbm-webpublish). -<div id="links"><p>Loading the links...</p></div> +Follow the list in sfeed or another feed reader: +[links/atom.xml](links/atom.xml). Or get it as plain text, one link on +each line (URL, description and tags, with a tab between them), as in +[sbm](https://github.com/equwal/sbm): [links/links.txt](links/links.txt). -<noscript><p>The list needs JavaScript. The raw list is at -<a href="links/links.json">links/links.json</a>.</p></noscript> - -<script> -// Show links.json from sbm-webpublish, grouped by the first tag of each link. -fetch("links/links.json") - .then(function (r) { if (!r.ok) throw r.status; return r.json(); }) - .then(function (links) { - var box = document.getElementById("links"); - box.textContent = ""; - var groups = {}, order = []; - links.forEach(function (l) { - var g = l.tags[0] || "other"; - if (!groups[g]) { groups[g] = []; order.push(g); } - groups[g].push(l); - }); - order.forEach(function (g) { - var h = document.createElement("h3"); - h.textContent = g; - var ul = document.createElement("ul"); - groups[g].forEach(function (l) { - var li = document.createElement("li"); - var a = document.createElement("a"); - a.href = l.url; - a.textContent = l.title; - li.appendChild(a); - li.appendChild(document.createTextNode(" (" + l.host + ")")); - ul.appendChild(li); - }); - box.appendChild(h); - box.appendChild(ul); - }); - if (!links.length) box.textContent = "No links yet."; - }) - .catch(function () { - document.getElementById("links").textContent = "The links did not load."; - }); -</script> +<!--# include virtual="/links/list.html" -->