diff options
| author | Joe Carstairs <me@joeac.net> | 2026-06-18 10:13:54 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-06-18 10:13:54 +0100 |
| commit | caed7bbfdfef88a28ac924e9d5ccf536a0b63284 (patch) | |
| tree | eecd9d142a21143cd1a70a953ee424e75f4d7bdc /http/src/blog | |
| parent | ff9df11a15f23aa55fc26c95b015377adfcf9caf (diff) | |
http: adds blog/rss/xml
Diffstat (limited to 'http/src/blog')
| -rw-r--r-- | http/src/blog/rss.uppxml | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/http/src/blog/rss.uppxml b/http/src/blog/rss.uppxml new file mode 100644 index 0000000..93955a9 --- /dev/null +++ b/http/src/blog/rss.uppxml @@ -0,0 +1,44 @@ +#! +SITE_URL="$1" +POSTS="$(ls --reverse "${SRC}/blog/" | grep "^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\(\.[0-9]\+\)\?\.blog.upphtml$")" +NOW_RFC_822="$(TZ=UT date +"%a, %d %b %Y %H:%M:%S UT")" +#! + +<rss version="2.0"> + +<channel> +<title>Joe Carstairs’ blog</title> +<description>Short posts on random topics I find interesting</description> +<link>${SITE_URL}/blog</link> +<image>${SITE_URL}/images/headshot.webp</image> +<language>en-GB</language> +<pubDate>${NOW_RFC_822}</pubDate> + +#! +for post in $POSTS; do +POST_ID="${post::${#post}-13}" +source "${SRC}/blog/${post}.args" +DATE_PUBLISHED_RFC_822="$(TZ=UT date --date="${POST_ID}" +"%a, %d %b %Y %H:%M:%S UT")" +#! +<item> + +<title>${POST_TITLE}</title> +<link>${SITE_URL}/blog/${POST_ID}</link> +<guid isPermaLink='true'>${SITE_URL}/blog/${POST_ID}</guid> +<pubDate>${DATE_PUBLISHED_RFC_822}</pubDate> +<description>${POST_DESCRIPTION:-${POST_TITLE}}</description> +<content:encoded> +#! +pp "${SRC}/blog/$post" "${SITE_URL}" +#! +</content:encoded> +<author>Joe Carstairs</author> + +</item> +#! +done +#! + +</channel> + +</rss>; |
