diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-10-09 23:03:07 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-10-09 23:03:07 +0200 |
| commit | 53a7024dc41a8750ceb15071b053ea67d48ff496 (patch) | |
| tree | 86346ec12b80a32750af13fc14706f45fcd12143 | |
| parent | 9c53e6a358c51f1e92e38f430673e8d7f8843cde (diff) | |
| download | sebastiano.tronto.net-53a7024dc41a8750ceb15071b053ea67d48ff496.tar.gz sebastiano.tronto.net-53a7024dc41a8750ceb15071b053ea67d48ff496.zip | |
Some feed.xml fixes
| -rwxr-xr-x | build.sh | 50 | ||||
| -rw-r--r-- | feed-top.xml | 4 |
2 files changed, 51 insertions, 3 deletions
| @@ -61,6 +61,7 @@ makeblogindexandfeed() { | |||
| 61 | f="src/blog/$i/*.md" | 61 | f="src/blog/$i/*.md" |
| 62 | d="$(echo "$i" | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}')" | 62 | d="$(echo "$i" | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}')" |
| 63 | t="$(head -n 1 $f | sed 's/# //')" | 63 | t="$(head -n 1 $f | sed 's/# //')" |
| 64 | link="https://sebastiano.tronto.net/blog/$i" | ||
| 64 | 65 | ||
| 65 | thisyear="$(echo "$d" | sed 's/-.*//')" | 66 | thisyear="$(echo "$d" | sed 's/-.*//')" |
| 66 | if [ "$thisyear" != "$lastyear" ]; then | 67 | if [ "$thisyear" != "$lastyear" ]; then |
| @@ -71,11 +72,15 @@ makeblogindexandfeed() { | |||
| 71 | { echo "<tr><td>$d</td>"; | 72 | { echo "<tr><td>$d</td>"; |
| 72 | echo "<td><a href=\"$i\">$t</a></td></tr>"; } >> "$bf" | 73 | echo "<td><a href=\"$i\">$t</a></td></tr>"; } >> "$bf" |
| 73 | 74 | ||
| 75 | dd="$(echo "$d" | sed 's/.*-//')" | ||
| 76 | mm="$(echo "$d" | sed 's/....-//' | sed 's/-.*//')" | ||
| 77 | mon="$(month "$mm")" | ||
| 74 | { echo "<item>"; | 78 | { echo "<item>"; |
| 75 | echo "<title>$t</title>"; | 79 | echo "<title>$t</title>"; |
| 76 | echo "<link>https://sebastiano.tronto.net/blog/$i</link>"; | 80 | echo "<link>$link</link>"; |
| 81 | echo "<guid isPermaLink=\"true\">$link</guid>"; | ||
| 77 | echo "<description>$t</description>"; | 82 | echo "<description>$t</description>"; |
| 78 | echo "<pubDate>$d</pubDate>"; | 83 | echo "<pubDate>$dd $mon $thisyear 00:00:00 GMT</pubDate>"; |
| 79 | echo "</item>"; | 84 | echo "</item>"; |
| 80 | echo ""; } >> $ff | 85 | echo ""; } >> $ff |
| 81 | done | 86 | done |
| @@ -86,5 +91,46 @@ makeblogindexandfeed() { | |||
| 86 | { echo ""; echo "</channel>"; echo "</rss>"; } >> "$ff" | 91 | { echo ""; echo "</channel>"; echo "</rss>"; } >> "$ff" |
| 87 | } | 92 | } |
| 88 | 93 | ||
| 94 | month() { | ||
| 95 | case "$1" in | ||
| 96 | 01) | ||
| 97 | echo "Jan" | ||
| 98 | ;; | ||
| 99 | 02) | ||
| 100 | echo "Feb" | ||
| 101 | ;; | ||
| 102 | 03) | ||
| 103 | echo "Mar" | ||
| 104 | ;; | ||
| 105 | 04) | ||
| 106 | echo "Apr" | ||
| 107 | ;; | ||
| 108 | 05) | ||
| 109 | echo "May" | ||
| 110 | ;; | ||
| 111 | 06) | ||
| 112 | echo "Jun" | ||
| 113 | ;; | ||
| 114 | 07) | ||
| 115 | echo "Jul" | ||
| 116 | ;; | ||
| 117 | 08) | ||
| 118 | echo "Aug" | ||
| 119 | ;; | ||
| 120 | 09) | ||
| 121 | echo "Sep" | ||
| 122 | ;; | ||
| 123 | 10) | ||
| 124 | echo "Oct" | ||
| 125 | ;; | ||
| 126 | 11) | ||
| 127 | echo "Nov" | ||
| 128 | ;; | ||
| 129 | 12) | ||
| 130 | echo "Dec" | ||
| 131 | ;; | ||
| 132 | esac | ||
| 133 | } | ||
| 134 | |||
| 89 | makeblogindexandfeed | 135 | makeblogindexandfeed |
| 90 | recursivebuild src | 136 | recursivebuild src |
diff --git a/feed-top.xml b/feed-top.xml index b4e2251..d320048 100644 --- a/feed-top.xml +++ b/feed-top.xml | |||
| @@ -1,9 +1,11 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8" ?> | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <rss version="2.0"> | 2 | <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
| 3 | 3 | ||
| 4 | <channel> | 4 | <channel> |
| 5 | <title>Sebastiano Tronto's blog</title> | 5 | <title>Sebastiano Tronto's blog</title> |
| 6 | <link>https://sebastiano.tronto.net/blog</link> | 6 | <link>https://sebastiano.tronto.net/blog</link> |
| 7 | <atom:link href="https://sebastiano.tronto.net/blog/feed.xml" | ||
| 8 | rel="self" type="application/rss+xml" /> | ||
| 7 | <description> | 9 | <description> |
| 8 | Thoughts about software, computers and whatever I feel like sharing | 10 | Thoughts about software, computers and whatever I feel like sharing |
| 9 | </description> | 11 | </description> |
