From 0c080d7c859dabc942e0fe13a1289b087e1093c8 Mon Sep 17 00:00:00 2001 From: Kumar Damani Date: Mon, 3 Aug 2026 13:27:57 -0400 Subject: removed rss feed in favour of atom --- feed.typ | 47 +++-------------------------------------------- global/common.typ | 3 +-- main.typ | 3 +-- 3 files changed, 5 insertions(+), 48 deletions(-) diff --git a/feed.typ b/feed.typ index 3a5fd21..a72a536 100644 --- a/feed.typ +++ b/feed.typ @@ -1,19 +1,11 @@ -// RSS 2.0 and Atom feeds for the blog posts, emitted as feed.xml and -// atom.xml by main.typ. Entries are built from the metadata in -// site-info.pages (newest first). +// Atom (RFC 4287) feed for the blog posts, emitted as atom.xml by +// main.typ. Entries are built from the metadata in site-info.pages +// (newest first). #import "/global/common.typ": baseurl #let xml-escape(s) = s.replace("&", "&").replace("<", "<").replace(">", ">") -// ISO date ("2026-07-28") to RFC 822 ("Tue, 28 Jul 2026 00:00:00 GMT"). -#let rfc822(iso) = { - let (y, m, d) = iso.split("-").map(int) - datetime(year: y, month: m, day: d).display( - "[weekday repr:short], [day] [month repr:short] [year] 00:00:00 GMT" - ) -} - // ISO date ("2026-07-28") to RFC 3339 ("2026-07-28T00:00:00Z"). #let rfc3339(iso) = iso + "T00:00:00Z" @@ -31,39 +23,6 @@ entries } -#let feed-xml(site-info) = { - let items = _entries(site-info, (title, url, p) => { - let lines = ( - " ", - " " + xml-escape(title) + "", - " " + url + "", - " " + url + "", - ) - if "date" in p { - lines.push(" " + rfc822(p.date) + "") - } - if "description" in p { - lines.push(" " + xml-escape(p.description) + "") - } - lines.push(" ") - lines.join("\n") - }) - - ( - "", - "", - "", - " " + xml-escape(site-info.title) + "", - " " + baseurl + "/", - " Posts from " + xml-escape(site-info.title) + " (" + baseurl + ")", - items.join("\n"), - "", - "", - "", - ).join("\n") -} - -// Atom (RFC 4287) feed, emitted as atom.xml by main.typ. #let atom-xml(site-info) = { let entries = _entries(site-info, (title, url, p) => { let lines = ( diff --git a/global/common.typ b/global/common.typ index 269fc62..2b8fa7e 100644 --- a/global/common.typ +++ b/global/common.typ @@ -184,7 +184,6 @@ html.link(rel: "icon", href: base + "favicon.ico") html.elem("link", attrs: (rel: "preload", href: base + "extlink.svg", "as": "image")) html.link(rel: "stylesheet", href: base + "main.css") - html.link(rel: "alternate", type: "application/rss+xml", title: site + " RSS", href: base + "feed.xml") html.link(rel: "alternate", type: "application/atom+xml", title: site + " Atom", href: base + "atom.xml") for ss in stylesheets { @@ -232,7 +231,7 @@ html.footer({ html.span(class: "updated")[\[Updated: #ci.date.\]] html.span(class: "logs")[ - \[For nerds: #extlink(srcurl)[site source], #extlink(ci.link)[logs], #link(base + "feed.xml")[rss], #link(base + "atom.xml")[atom]\] + \[For nerds: #extlink(srcurl)[site source], #extlink(ci.link)[logs], #link(base + "atom.xml")[atom]\] ] }) }) diff --git a/main.typ b/main.typ index 8eea0e2..9a76286 100644 --- a/main.typ +++ b/main.typ @@ -4,7 +4,7 @@ #import "/global/common.typ": * #import "/site.typ": site-info -#import "/feed.typ": feed-xml, atom-xml +#import "/feed.typ": atom-xml #import "/index.typ" as index-page #import "/software.typ" as software-page @@ -75,7 +75,6 @@ #asset("extlink.svg", read("/global/extlink.svg", encoding: none)) #asset("favicon.ico", read("/global/favicon.ico", encoding: none)) #asset("favicon.svg", read("/global/favicon.svg", encoding: none)) -#asset("feed.xml", bytes(feed-xml(site-info))) #asset("atom.xml", bytes(atom-xml(site-info))) // image assets collected from pages via the img/fig helpers -- cgit v1.2.3