From c0673c23500eadb6d268b9650a4c79f1f4de4f4d Mon Sep 17 00:00:00 2001 From: Bradley Taunt Date: Mon, 20 Jan 2025 15:39:24 -0500 Subject: Minimal stylin changes, about page, table cleanup --- posts/rss-hacks.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'posts/rss-hacks.md') diff --git a/posts/rss-hacks.md b/posts/rss-hacks.md index 3d1890c..666d72c 100644 --- a/posts/rss-hacks.md +++ b/posts/rss-hacks.md @@ -15,8 +15,10 @@ Since the shinobi script generates valid RSS code by default, I didn't want to m My first attempt was to use the available `sort` parameter (in XSL version 1.1+) targeting the `dc:date` type linked to the `pubDate` element: - - +~~~html + + +~~~ This did not work as intended. RSS 2.0 requires that the `pubDate` content is set to comply with the RFC-822 date-time[^4], which shinobi handles perfectly fine. The issue came from the XSL `sort` parameter not honoring this setting across all dates. My best guess is that it struggles to properly organize posts from their "month" parameter, so it sets the posts in order of date in what I refer to as "monthly sections". @@ -32,13 +34,17 @@ Then I remembered the `category` tag which shinobi does not utilize by default. First I needed to convert the RFC-822 formatted date (found on the first line of all blog post text files) and render it inside a `category` tag. This was simple enough: - $(date -j -f "%a, %d %b %Y" "$(head -n 1 $file)" +"%Y/%m/%d/%u") +~~~sh +$(date -j -f "%a, %d %b %Y" "$(head -n 1 $file)" +"%Y/%m/%d/%u") +~~~ In a nutshell, this converts the RFC-822 date into the format "2022/05/24/2". Simple numbers that can be sorted much easier by XSL. Now all that was needed was setting to `sort` parameter properly: - +~~~sh + +~~~ Everything worked perfectly and the RSS was still valid! -- cgit v1.2.3-70-g09d2