diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2022-05-20 21:27:20 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2022-05-20 21:27:20 +0200 |
| commit | a9f3c8acf55984553e13e3343003717eaf1abc96 (patch) | |
| tree | 3503e3fed4d3b5486c29803cbbd9144ccf3d4939 | |
| parent | b2de644f640215fa5c92087cb6fa7b03b0f2a478 (diff) | |
| download | sebastiano.tronto.net-a9f3c8acf55984553e13e3343003717eaf1abc96.tar.gz sebastiano.tronto.net-a9f3c8acf55984553e13e3343003717eaf1abc96.zip | |
Added blog
| -rwxr-xr-x | build.sh | 30 | ||||
| -rw-r--r-- | feed-top.xml | 10 | ||||
| -rw-r--r-- | src/blog/blog.md | 4 | ||||
| -rw-r--r-- | src/blog/feed.xml | 13 | ||||
| -rw-r--r-- | top.html | 3 |
5 files changed, 59 insertions, 1 deletions
| @@ -29,4 +29,34 @@ recursivebuild() { | |||
| 29 | done | 29 | done |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | makeblog() { | ||
| 33 | bf=src/blog/blog.md | ||
| 34 | ff=src/blog/feed.xml | ||
| 35 | |||
| 36 | printf "# Blog\n\n[RSS Feed](feed.xml)\n\n" > $bf | ||
| 37 | cp feed-top.xml $ff | ||
| 38 | |||
| 39 | for i in $(ls src/blog | sort -r); do | ||
| 40 | if [ -d src/blog/$i ]; then | ||
| 41 | f="src/blog/$i/*.md" | ||
| 42 | d=$(grep -E '^[0-9]{4}-[0-9]{2}-[0-9]{2}$' $f) | ||
| 43 | t=$(head -n 1 $f | sed 's/# //') | ||
| 44 | echo "* $d [$t]($i)" >> $bf | ||
| 45 | |||
| 46 | echo "<item>" >> $ff | ||
| 47 | echo "<title>$t</title>" >> $ff | ||
| 48 | echo "<link>https://sebastiano.tronto.net/blog/$i</link>" >> $ff | ||
| 49 | echo "<description>$t</description>" >> $ff | ||
| 50 | echo "<pubDate>$d</pubDate>" >> $ff | ||
| 51 | echo "</item>" >> $ff | ||
| 52 | echo "" >> $ff | ||
| 53 | fi | ||
| 54 | done | ||
| 55 | |||
| 56 | echo "" >> $ff | ||
| 57 | echo "</channel>" >> $ff | ||
| 58 | echo "</rss>" >> $ff | ||
| 59 | } | ||
| 60 | |||
| 61 | makeblog | ||
| 32 | recursivebuild src | 62 | recursivebuild src |
diff --git a/feed-top.xml b/feed-top.xml new file mode 100644 index 0000000..b4e2251 --- /dev/null +++ b/feed-top.xml | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | <rss version="2.0"> | ||
| 3 | |||
| 4 | <channel> | ||
| 5 | <title>Sebastiano Tronto's blog</title> | ||
| 6 | <link>https://sebastiano.tronto.net/blog</link> | ||
| 7 | <description> | ||
| 8 | Thoughts about software, computers and whatever I feel like sharing | ||
| 9 | </description> | ||
| 10 | |||
diff --git a/src/blog/blog.md b/src/blog/blog.md new file mode 100644 index 0000000..aa51ab7 --- /dev/null +++ b/src/blog/blog.md | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | # Blog | ||
| 2 | |||
| 3 | [RSS Feed](feed.xml) | ||
| 4 | |||
diff --git a/src/blog/feed.xml b/src/blog/feed.xml new file mode 100644 index 0000000..7154cf8 --- /dev/null +++ b/src/blog/feed.xml | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | <rss version="2.0"> | ||
| 3 | |||
| 4 | <channel> | ||
| 5 | <title>Sebastiano Tronto's blog</title> | ||
| 6 | <link>https://sebastiano.tronto.net/blog</link> | ||
| 7 | <description> | ||
| 8 | Thoughts about software, computers and whatever I feel like sharing | ||
| 9 | </description> | ||
| 10 | |||
| 11 | |||
| 12 | </channel> | ||
| 13 | </rss> | ||
| @@ -41,7 +41,8 @@ | |||
| 41 | <td class="links"> | 41 | <td class="links"> |
| 42 | <a href="/research/">Research</a> | | 42 | <a href="/research/">Research</a> | |
| 43 | <a href="/git/">Git</a> | | 43 | <a href="/git/">Git</a> | |
| 44 | <a href="/speedcubing/">Cubing</a> | 44 | <a href="/speedcubing/">Cubing</a> | |
| 45 | <a href="/blog/">Blog</a> | ||
| 45 | </td> | 46 | </td> |
| 46 | </tr> | 47 | </tr> |
| 47 | </table> | 48 | </table> |
