summaryrefslogtreecommitdiff
path: root/bin/make_html_archives.sh
diff options
context:
space:
mode:
authorJohannes Herman <johannes.herman@gmail.com>2025-12-11 06:49:19 +0100
committerJohannes Herman <johannes.herman@gmail.com>2025-12-11 06:49:19 +0100
commitc14aabfd17c85632bd68db60867edb3fb662c7e7 (patch)
treed3fc7a1c44bba6fa56c39bd77013911151977532 /bin/make_html_archives.sh
initial commit
Diffstat (limited to 'bin/make_html_archives.sh')
-rwxr-xr-xbin/make_html_archives.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/make_html_archives.sh b/bin/make_html_archives.sh
new file mode 100755
index 0000000..239f878
--- /dev/null
+++ b/bin/make_html_archives.sh
@@ -0,0 +1,31 @@
+#/bin/sh
+
+ARCHIVE_DIR="public/archives"
+
+for file in $ARCHIVE_DIR/*_demos.zip $ARCHIVE_DIR/*_videos.zip; do
+ [ -f "$file" ] || continue
+ base="${file%_demos.zip}"
+ base="${base%_videos.zip}"
+ base="${base#$ARCHIVE_DIR/}"
+ bases="$bases
+$base"
+done
+
+[ -n "$bases" ] && printf "\n<h2>Archives</h2>\n\n"
+
+for base in $(echo "$bases" | sort -u); do
+ title=$(echo "$base" | tr '_' ' ')
+
+ line="<p>$title tricks archive:"
+
+ video_archive="$ARCHIVE_DIR/${base}_videos.zip"
+ demo_archive="$ARCHIVE_DIR/${base}_demos.zip"
+
+ [ -f "$video_archive" ] && line="$line <a href=\"archives/${base}_videos.zip\">videos</a>"
+ [ -f "$demo_archive" ] && [ -f "$video_archive" ] && line="$line, "
+ [ -f "$demo_archive" ] && line="$line <a href=\"archives/${base}_demos.zip\">demos</a>"
+
+ echo "$line"
+
+done
+