diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | bottom.gmi | 7 | ||||
| -rwxr-xr-x | build.sh | 81 | ||||
| -rw-r--r-- | src/blog/blog.md | 35 | ||||
| -rw-r--r-- | src/blog/feed.xml | 188 |
5 files changed, 44 insertions, 268 deletions
| @@ -1,3 +1,2 @@ | |||
| 1 | http | 1 | http |
| 2 | gemini | ||
| 3 | HTML-TIPS | 2 | HTML-TIPS |
diff --git a/bottom.gmi b/bottom.gmi deleted file mode 100644 index e171bf0..0000000 --- a/bottom.gmi +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | --- | ||
| 2 | => mailto:sebastiano@tronto.net Email me at sebastiano@tronto.net | ||
| 3 | => / Home | ||
| 4 | => /blog Blog | ||
| 5 | => /speedcubing Cubing | ||
| 6 | => https://sebastiano.tronto.net website | ||
| 7 | => https://git.tronto.net webgit | ||
| @@ -1,14 +1,14 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | recursivebuild() { | 3 | recursivebuild() { |
| 4 | local destdir=$(echo $1 | sed 's|^src|http|') | 4 | local destdir=$(echo "$1" | sed 's|^src|http|') |
| 5 | mkdir -p "$destdir" | 5 | mkdir -p "$destdir" |
| 6 | for file in $(ls $1); do | 6 | for file in "$1"/*; do |
| 7 | if [ -d "$1/$file" ]; then | 7 | if [ -d "$file" ]; then |
| 8 | mkdir -p "$destdir/$file" | 8 | mkdir -p "$destdir/$(basename "$file")" |
| 9 | recursivebuild "$1/$file" | 9 | recursivebuild "$file" |
| 10 | else | 10 | else |
| 11 | copyfile "$1/$file" "$destdir" | 11 | copyfile "$file" "$destdir" |
| 12 | fi | 12 | fi |
| 13 | done | 13 | done |
| 14 | } | 14 | } |
| @@ -20,63 +20,70 @@ copyfile() { | |||
| 20 | extension=$(echo "$file" | sed 's/.*\.//') | 20 | extension=$(echo "$file" | sed 's/.*\.//') |
| 21 | case "$extension" in | 21 | case "$extension" in |
| 22 | md) | 22 | md) |
| 23 | t="$(markdowntitle $file)" | 23 | t="$(markdowntitle "$file")" |
| 24 | sed "s/TITLE/$t/" < top.html > "$ind" | 24 | sed "s/TITLE/$t/" < top.html > "$ind" |
| 25 | lowdown "$file" >> "$ind" | 25 | lowdown "$file" >> "$ind" |
| 26 | cat bottom.html >> "$ind" | 26 | cat bottom.html >> "$ind" |
| 27 | ;; | 27 | ;; |
| 28 | html) | 28 | html) |
| 29 | t="$(htmltitle $file)" | 29 | t="$(htmltitle "$file")" |
| 30 | cat top.html "$file" bottom.html | sed "s/TITLE/$t/" > "$ind" | 30 | cat top.html "$file" bottom.html | sed "s/TITLE/$t/" > "$ind" |
| 31 | ;; | 31 | ;; |
| 32 | *) | 32 | *) |
| 33 | cp "$file" "$dest/$(basename $file)" | 33 | cp "$file" "$dest/$(basename "$file")" |
| 34 | esac | 34 | esac |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | markdowntitle() { | 37 | markdowntitle() { |
| 38 | grep '^# ' $1 | head -n 1 | sed 's/^# //' | 38 | grep '^# ' "$1" | head -n 1 | sed 's/^# //' |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | htmltitle() { | 41 | htmltitle() { |
| 42 | grep '<!--TITLE: ' "$1" | sed 's/^<!--TITLE: //' | sed 's/-->$//' | 42 | grep '<!--TITLE: ' "$1" | sed 's/^<!--TITLE: //' | sed 's/-->$//' |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | makeblog() { | 45 | makeblogindexandfeed() { |
| 46 | bf=src/blog/blog.md | 46 | mkdir -p http/blog |
| 47 | ff=src/blog/feed.xml | 47 | bf=http/blog/index.html |
| 48 | ff=http/blog/feed.xml | ||
| 48 | 49 | ||
| 49 | printf "# Blog\n\n[RSS Feed](feed.xml)\n\n" > $bf | 50 | sed "s/TITLE/Blog/" < top.html > "$bf" |
| 50 | cp feed-top.xml $ff | 51 | { echo '<h1 id="blog">Blog</h1>'; |
| 52 | echo '<table id="blog">'; | ||
| 53 | echo '<a href="feed.xml">RSS feed</a>'; } >> "$bf" | ||
| 51 | 54 | ||
| 52 | for i in $(ls src/blog | sort -r); do | 55 | cp feed-top.xml "$ff" |
| 53 | if [ -d src/blog/$i ]; then | ||
| 54 | f="src/blog/$i/*.md" | ||
| 55 | d=$(echo $i | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}') | ||
| 56 | t=$(head -n 1 $f | sed 's/# //') | ||
| 57 | 56 | ||
| 58 | thisyear=$(echo $d | sed 's/-.*//') | 57 | for i in $(ls src/blog | sort -r); do |
| 59 | if [ "$thisyear" != "$lastyear" ]; then | 58 | [ -d "src/blog/$i" ] || continue |
| 60 | printf "\n## $thisyear\n\n" >> $bf | ||
| 61 | lastyear=$thisyear | ||
| 62 | fi | ||
| 63 | 59 | ||
| 64 | echo "* $d [$t]($i)" >> $bf | 60 | f="src/blog/$i/*.md" |
| 61 | d="$(echo "$i" | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}')" | ||
| 62 | t="$(head -n 1 $f | sed 's/# //')" | ||
| 65 | 63 | ||
| 66 | echo "<item>" >> $ff | 64 | thisyear="$(echo "$d" | sed 's/-.*//')" |
| 67 | echo "<title>$t</title>" >> $ff | 65 | if [ "$thisyear" != "$lastyear" ]; then |
| 68 | echo "<link>https://sebastiano.tronto.net/blog/$i</link>" >> $ff | 66 | echo "<tr><td><h2>$thisyear</h2></td></tr>" >> "$bf" |
| 69 | echo "<description>$t</description>" >> $ff | 67 | lastyear=$thisyear |
| 70 | echo "<pubDate>$d</pubDate>" >> $ff | ||
| 71 | echo "</item>" >> $ff | ||
| 72 | echo "" >> $ff | ||
| 73 | fi | 68 | fi |
| 69 | |||
| 70 | { echo "<tr><td>$d</td>"; | ||
| 71 | echo "<td><a href=\"$i\">$t</a></td></tr>"; } >> "$bf" | ||
| 72 | |||
| 73 | { echo "<item>"; | ||
| 74 | echo "<title>$t</title>"; | ||
| 75 | echo "<link>https://sebastiano.tronto.net/blog/$i</link>"; | ||
| 76 | echo "<description>$t</description>"; | ||
| 77 | echo "<pubDate>$d</pubDate>"; | ||
| 78 | echo "</item>"; | ||
| 79 | echo ""; } >> $ff | ||
| 74 | done | 80 | done |
| 75 | 81 | ||
| 76 | echo "" >> $ff | 82 | echo '</table>' >> "$bf" |
| 77 | echo "</channel>" >> $ff | 83 | cat bottom.html >> "$bf" |
| 78 | echo "</rss>" >> $ff | 84 | |
| 85 | { echo ""; echo "</channel>"; echo "</rss>"; } >> "$ff" | ||
| 79 | } | 86 | } |
| 80 | 87 | ||
| 81 | makeblog | 88 | makeblogindexandfeed |
| 82 | recursivebuild src | 89 | recursivebuild src |
diff --git a/src/blog/blog.md b/src/blog/blog.md deleted file mode 100644 index 6c21cd5..0000000 --- a/src/blog/blog.md +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | # Blog | ||
| 2 | |||
| 3 | [RSS Feed](feed.xml) | ||
| 4 | |||
| 5 | |||
| 6 | ## 2023 | ||
| 7 | |||
| 8 | * 2023-07-11 [My minimalistic RSS feed setup](2023-07-11-feed) | ||
| 9 | * 2023-06-16 [UNIX text filters, part 0 of 3: regular expressions](2023-06-16-regex) | ||
| 10 | * 2023-05-05 [I had to debug C code on a smartphone](2023-05-05-debug-smartphone) | ||
| 11 | * 2023-04-10 [The big rewrite](2023-04-10-the-big-rewrite) | ||
| 12 | * 2023-03-30 [The man page reading club: dc(1)](2023-03-30-dc) | ||
| 13 | * 2023-03-06 [Resizing my website's pictures with ImageMagick and find(1)](2023-03-06-resize-pictures) | ||
| 14 | * 2023-02-25 [Job control: one shell is all you need](2023-02-25-job-control) | ||
| 15 | * 2023-01-28 [The year of the Windows desktop](2023-01-28-windows-desktop) | ||
| 16 | * 2023-01-11 [Aaron Swartz](2023-01-11-aaron-swartz) | ||
| 17 | |||
| 18 | ## 2022 | ||
| 19 | |||
| 20 | * 2022-12-30 [Getting my blog ready for 2023](2022-12-30-blog-ready) | ||
| 21 | * 2022-12-24 [The man page reading club: ed(1)](2022-12-24-ed) | ||
| 22 | * 2022-11-23 [Self-hosted git pages with stagit (featuring ed, the standard editor)](2022-11-23-git-host) | ||
| 23 | * 2022-10-19 [Keeping my email sorted (the hard way)](2022-10-19-email-setup) | ||
| 24 | * 2022-10-01 [The man page reading club: tetris(6)](2022-10-01-tetris) | ||
| 25 | * 2022-09-20 [The man page reading club: sh(1) - part 2: commands and builtins](2022-09-20-sh-2) | ||
| 26 | * 2022-09-13 [The man page reading club: sh(1) - part 1: shell grammar](2022-09-13-sh-1) | ||
| 27 | * 2022-09-10 [Long live netbooks!](2022-09-10-netbooks) | ||
| 28 | * 2022-09-05 [Pipe man into col -b to get rid of \^H](2022-09-05-man-col) | ||
| 29 | * 2022-08-14 [How I update my website](2022-08-14-website) | ||
| 30 | * 2022-07-07 [The man page reading club: shutdown(8)](2022-07-07-shutdown) | ||
| 31 | * 2022-06-12 [The UNIX shell as an IDE: look stuff up with sed](2022-06-12-shell-ide-sed) | ||
| 32 | * 2022-06-08 [The man page reading club: more(1)](2022-06-08-more) | ||
| 33 | * 2022-06-04 [The gemini protocol](2022-06-04-gemini) | ||
| 34 | * 2022-05-29 [The man page reading club: man(1)](2022-05-29-man) | ||
| 35 | * 2022-05-21 [Blogs](2022-05-21-blogs) | ||
diff --git a/src/blog/feed.xml b/src/blog/feed.xml deleted file mode 100644 index 9c39603..0000000 --- a/src/blog/feed.xml +++ /dev/null | |||
| @@ -1,188 +0,0 @@ | |||
| 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 | <item> | ||
| 12 | <title>My minimalistic RSS feed setup</title> | ||
| 13 | <link>https://sebastiano.tronto.net/blog/2023-07-11-feed</link> | ||
| 14 | <description>My minimalistic RSS feed setup</description> | ||
| 15 | <pubDate>2023-07-11</pubDate> | ||
| 16 | </item> | ||
| 17 | |||
| 18 | <item> | ||
| 19 | <title>UNIX text filters, part 0 of 3: regular expressions</title> | ||
| 20 | <link>https://sebastiano.tronto.net/blog/2023-06-16-regex</link> | ||
| 21 | <description>UNIX text filters, part 0 of 3: regular expressions</description> | ||
| 22 | <pubDate>2023-06-16</pubDate> | ||
| 23 | </item> | ||
| 24 | |||
| 25 | <item> | ||
| 26 | <title>I had to debug C code on a smartphone</title> | ||
| 27 | <link>https://sebastiano.tronto.net/blog/2023-05-05-debug-smartphone</link> | ||
| 28 | <description>I had to debug C code on a smartphone</description> | ||
| 29 | <pubDate>2023-05-05</pubDate> | ||
| 30 | </item> | ||
| 31 | |||
| 32 | <item> | ||
| 33 | <title>The big rewrite</title> | ||
| 34 | <link>https://sebastiano.tronto.net/blog/2023-04-10-the-big-rewrite</link> | ||
| 35 | <description>The big rewrite</description> | ||
| 36 | <pubDate>2023-04-10</pubDate> | ||
| 37 | </item> | ||
| 38 | |||
| 39 | <item> | ||
| 40 | <title>The man page reading club: dc(1)</title> | ||
| 41 | <link>https://sebastiano.tronto.net/blog/2023-03-30-dc</link> | ||
| 42 | <description>The man page reading club: dc(1)</description> | ||
| 43 | <pubDate>2023-03-30</pubDate> | ||
| 44 | </item> | ||
| 45 | |||
| 46 | <item> | ||
| 47 | <title>Resizing my website's pictures with ImageMagick and find(1)</title> | ||
| 48 | <link>https://sebastiano.tronto.net/blog/2023-03-06-resize-pictures</link> | ||
| 49 | <description>Resizing my website's pictures with ImageMagick and find(1)</description> | ||
| 50 | <pubDate>2023-03-06</pubDate> | ||
| 51 | </item> | ||
| 52 | |||
| 53 | <item> | ||
| 54 | <title>Job control: one shell is all you need</title> | ||
| 55 | <link>https://sebastiano.tronto.net/blog/2023-02-25-job-control</link> | ||
| 56 | <description>Job control: one shell is all you need</description> | ||
| 57 | <pubDate>2023-02-25</pubDate> | ||
| 58 | </item> | ||
| 59 | |||
| 60 | <item> | ||
| 61 | <title>The year of the Windows desktop</title> | ||
| 62 | <link>https://sebastiano.tronto.net/blog/2023-01-28-windows-desktop</link> | ||
| 63 | <description>The year of the Windows desktop</description> | ||
| 64 | <pubDate>2023-01-28</pubDate> | ||
| 65 | </item> | ||
| 66 | |||
| 67 | <item> | ||
| 68 | <title>Aaron Swartz</title> | ||
| 69 | <link>https://sebastiano.tronto.net/blog/2023-01-11-aaron-swartz</link> | ||
| 70 | <description>Aaron Swartz</description> | ||
| 71 | <pubDate>2023-01-11</pubDate> | ||
| 72 | </item> | ||
| 73 | |||
| 74 | <item> | ||
| 75 | <title>Getting my blog ready for 2023</title> | ||
| 76 | <link>https://sebastiano.tronto.net/blog/2022-12-30-blog-ready</link> | ||
| 77 | <description>Getting my blog ready for 2023</description> | ||
| 78 | <pubDate>2022-12-30</pubDate> | ||
| 79 | </item> | ||
| 80 | |||
| 81 | <item> | ||
| 82 | <title>The man page reading club: ed(1)</title> | ||
| 83 | <link>https://sebastiano.tronto.net/blog/2022-12-24-ed</link> | ||
| 84 | <description>The man page reading club: ed(1)</description> | ||
| 85 | <pubDate>2022-12-24</pubDate> | ||
| 86 | </item> | ||
| 87 | |||
| 88 | <item> | ||
| 89 | <title>Self-hosted git pages with stagit (featuring ed, the standard editor)</title> | ||
| 90 | <link>https://sebastiano.tronto.net/blog/2022-11-23-git-host</link> | ||
| 91 | <description>Self-hosted git pages with stagit (featuring ed, the standard editor)</description> | ||
| 92 | <pubDate>2022-11-23</pubDate> | ||
| 93 | </item> | ||
| 94 | |||
| 95 | <item> | ||
| 96 | <title>Keeping my email sorted (the hard way)</title> | ||
| 97 | <link>https://sebastiano.tronto.net/blog/2022-10-19-email-setup</link> | ||
| 98 | <description>Keeping my email sorted (the hard way)</description> | ||
| 99 | <pubDate>2022-10-19</pubDate> | ||
| 100 | </item> | ||
| 101 | |||
| 102 | <item> | ||
| 103 | <title>The man page reading club: tetris(6)</title> | ||
| 104 | <link>https://sebastiano.tronto.net/blog/2022-10-01-tetris</link> | ||
| 105 | <description>The man page reading club: tetris(6)</description> | ||
| 106 | <pubDate>2022-10-01</pubDate> | ||
| 107 | </item> | ||
| 108 | |||
| 109 | <item> | ||
| 110 | <title>The man page reading club: sh(1) - part 2: commands and builtins</title> | ||
| 111 | <link>https://sebastiano.tronto.net/blog/2022-09-20-sh-2</link> | ||
| 112 | <description>The man page reading club: sh(1) - part 2: commands and builtins</description> | ||
| 113 | <pubDate>2022-09-20</pubDate> | ||
| 114 | </item> | ||
| 115 | |||
| 116 | <item> | ||
| 117 | <title>The man page reading club: sh(1) - part 1: shell grammar</title> | ||
| 118 | <link>https://sebastiano.tronto.net/blog/2022-09-13-sh-1</link> | ||
| 119 | <description>The man page reading club: sh(1) - part 1: shell grammar</description> | ||
| 120 | <pubDate>2022-09-13</pubDate> | ||
| 121 | </item> | ||
| 122 | |||
| 123 | <item> | ||
| 124 | <title>Long live netbooks!</title> | ||
| 125 | <link>https://sebastiano.tronto.net/blog/2022-09-10-netbooks</link> | ||
| 126 | <description>Long live netbooks!</description> | ||
| 127 | <pubDate>2022-09-10</pubDate> | ||
| 128 | </item> | ||
| 129 | |||
| 130 | <item> | ||
| 131 | <title>Pipe man into col -b to get rid of \^H</title> | ||
| 132 | <link>https://sebastiano.tronto.net/blog/2022-09-05-man-col</link> | ||
| 133 | <description>Pipe man into col -b to get rid of \^H</description> | ||
| 134 | <pubDate>2022-09-05</pubDate> | ||
| 135 | </item> | ||
| 136 | |||
| 137 | <item> | ||
| 138 | <title>How I update my website</title> | ||
| 139 | <link>https://sebastiano.tronto.net/blog/2022-08-14-website</link> | ||
| 140 | <description>How I update my website</description> | ||
| 141 | <pubDate>2022-08-14</pubDate> | ||
| 142 | </item> | ||
| 143 | |||
| 144 | <item> | ||
| 145 | <title>The man page reading club: shutdown(8)</title> | ||
| 146 | <link>https://sebastiano.tronto.net/blog/2022-07-07-shutdown</link> | ||
| 147 | <description>The man page reading club: shutdown(8)</description> | ||
| 148 | <pubDate>2022-07-07</pubDate> | ||
| 149 | </item> | ||
| 150 | |||
| 151 | <item> | ||
| 152 | <title>The UNIX shell as an IDE: look stuff up with sed</title> | ||
| 153 | <link>https://sebastiano.tronto.net/blog/2022-06-12-shell-ide-sed</link> | ||
| 154 | <description>The UNIX shell as an IDE: look stuff up with sed</description> | ||
| 155 | <pubDate>2022-06-12</pubDate> | ||
| 156 | </item> | ||
| 157 | |||
| 158 | <item> | ||
| 159 | <title>The man page reading club: more(1)</title> | ||
| 160 | <link>https://sebastiano.tronto.net/blog/2022-06-08-more</link> | ||
| 161 | <description>The man page reading club: more(1)</description> | ||
| 162 | <pubDate>2022-06-08</pubDate> | ||
| 163 | </item> | ||
| 164 | |||
| 165 | <item> | ||
| 166 | <title>The gemini protocol</title> | ||
| 167 | <link>https://sebastiano.tronto.net/blog/2022-06-04-gemini</link> | ||
| 168 | <description>The gemini protocol</description> | ||
| 169 | <pubDate>2022-06-04</pubDate> | ||
| 170 | </item> | ||
| 171 | |||
| 172 | <item> | ||
| 173 | <title>The man page reading club: man(1)</title> | ||
| 174 | <link>https://sebastiano.tronto.net/blog/2022-05-29-man</link> | ||
| 175 | <description>The man page reading club: man(1)</description> | ||
| 176 | <pubDate>2022-05-29</pubDate> | ||
| 177 | </item> | ||
| 178 | |||
| 179 | <item> | ||
| 180 | <title>Blogs</title> | ||
| 181 | <link>https://sebastiano.tronto.net/blog/2022-05-21-blogs</link> | ||
| 182 | <description>Blogs</description> | ||
| 183 | <pubDate>2022-05-21</pubDate> | ||
| 184 | </item> | ||
| 185 | |||
| 186 | |||
| 187 | </channel> | ||
| 188 | </rss> | ||
