sebastiano.tronto.net

Source files and build scripts for my personal website
git clone https://git.tronto.net/sebastiano.tronto.net
Download | Log | Files | Refs | README

commit 53a7024dc41a8750ceb15071b053ea67d48ff496
parent 9c53e6a358c51f1e92e38f430673e8d7f8843cde
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Wed,  9 Oct 2024 23:03:07 +0200

Some feed.xml fixes

Diffstat:
Mbuild.sh | 50++++++++++++++++++++++++++++++++++++++++++++++++--
Mfeed-top.xml | 4+++-
2 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/build.sh b/build.sh @@ -61,6 +61,7 @@ makeblogindexandfeed() { f="src/blog/$i/*.md" d="$(echo "$i" | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}')" t="$(head -n 1 $f | sed 's/# //')" + link="https://sebastiano.tronto.net/blog/$i" thisyear="$(echo "$d" | sed 's/-.*//')" if [ "$thisyear" != "$lastyear" ]; then @@ -71,11 +72,15 @@ makeblogindexandfeed() { { echo "<tr><td>$d</td>"; echo "<td><a href=\"$i\">$t</a></td></tr>"; } >> "$bf" + dd="$(echo "$d" | sed 's/.*-//')" + mm="$(echo "$d" | sed 's/....-//' | sed 's/-.*//')" + mon="$(month "$mm")" { echo "<item>"; echo "<title>$t</title>"; - echo "<link>https://sebastiano.tronto.net/blog/$i</link>"; + echo "<link>$link</link>"; + echo "<guid isPermaLink=\"true\">$link</guid>"; echo "<description>$t</description>"; - echo "<pubDate>$d</pubDate>"; + echo "<pubDate>$dd $mon $thisyear 00:00:00 GMT</pubDate>"; echo "</item>"; echo ""; } >> $ff done @@ -86,5 +91,46 @@ makeblogindexandfeed() { { echo ""; echo "</channel>"; echo "</rss>"; } >> "$ff" } +month() { + case "$1" in + 01) + echo "Jan" + ;; + 02) + echo "Feb" + ;; + 03) + echo "Mar" + ;; + 04) + echo "Apr" + ;; + 05) + echo "May" + ;; + 06) + echo "Jun" + ;; + 07) + echo "Jul" + ;; + 08) + echo "Aug" + ;; + 09) + echo "Sep" + ;; + 10) + echo "Oct" + ;; + 11) + echo "Nov" + ;; + 12) + echo "Dec" + ;; + esac +} + makeblogindexandfeed recursivebuild src diff --git a/feed-top.xml b/feed-top.xml @@ -1,9 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> -<rss version="2.0"> +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>Sebastiano Tronto's blog</title> <link>https://sebastiano.tronto.net/blog</link> +<atom:link href="https://sebastiano.tronto.net/blog/feed.xml" + rel="self" type="application/rss+xml" /> <description> Thoughts about software, computers and whatever I feel like sharing </description>