commit a9f3c8acf55984553e13e3343003717eaf1abc96
parent b2de644f640215fa5c92087cb6fa7b03b0f2a478
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Fri, 20 May 2022 21:27:20 +0200
Added blog
Diffstat:
5 files changed, 59 insertions(+), 1 deletion(-)
diff --git a/build.sh b/build.sh
@@ -29,4 +29,34 @@ recursivebuild() {
done
}
+makeblog() {
+ bf=src/blog/blog.md
+ ff=src/blog/feed.xml
+
+ printf "# Blog\n\n[RSS Feed](feed.xml)\n\n" > $bf
+ cp feed-top.xml $ff
+
+ for i in $(ls src/blog | sort -r); do
+ if [ -d src/blog/$i ]; then
+ f="src/blog/$i/*.md"
+ d=$(grep -E '^[0-9]{4}-[0-9]{2}-[0-9]{2}$' $f)
+ t=$(head -n 1 $f | sed 's/# //')
+ echo "* $d [$t]($i)" >> $bf
+
+ echo "<item>" >> $ff
+ echo "<title>$t</title>" >> $ff
+ echo "<link>https://sebastiano.tronto.net/blog/$i</link>" >> $ff
+ echo "<description>$t</description>" >> $ff
+ echo "<pubDate>$d</pubDate>" >> $ff
+ echo "</item>" >> $ff
+ echo "" >> $ff
+ fi
+ done
+
+ echo "" >> $ff
+ echo "</channel>" >> $ff
+ echo "</rss>" >> $ff
+}
+
+makeblog
recursivebuild src
diff --git a/feed-top.xml b/feed-top.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<rss version="2.0">
+
+<channel>
+<title>Sebastiano Tronto's blog</title>
+<link>https://sebastiano.tronto.net/blog</link>
+<description>
+Thoughts about software, computers and whatever I feel like sharing
+</description>
+
diff --git a/src/blog/blog.md b/src/blog/blog.md
@@ -0,0 +1,4 @@
+# Blog
+
+[RSS Feed](feed.xml)
+
diff --git a/src/blog/feed.xml b/src/blog/feed.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<rss version="2.0">
+
+<channel>
+<title>Sebastiano Tronto's blog</title>
+<link>https://sebastiano.tronto.net/blog</link>
+<description>
+Thoughts about software, computers and whatever I feel like sharing
+</description>
+
+
+</channel>
+</rss>
diff --git a/top.html b/top.html
@@ -41,7 +41,8 @@
<td class="links">
<a href="/research/">Research</a> |
<a href="/git/">Git</a> |
- <a href="/speedcubing/">Cubing</a>
+ <a href="/speedcubing/">Cubing</a> |
+ <a href="/blog/">Blog</a>
</td>
</tr>
</table>