From cdab944f806f94404b5f9bc0231ed1af43bcb888 Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 19 Aug 2023 18:23:17 +0000 Subject: added an image gallery generator script. --- mkgallery | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 mkgallery (limited to 'mkgallery') diff --git a/mkgallery b/mkgallery new file mode 100755 index 0000000..6791a8f --- /dev/null +++ b/mkgallery @@ -0,0 +1,38 @@ +#!/bin/rc +rfork en + +fn entitle { + basename $1 | sed 's/-/ /g' | bin/capitalize +} + +fn usage { + echo usage: $0 path >[1=2] + exit usage +} + +if(! ~ $#* 1) + usage + +if(! test -d $1) + usage + +media=`{walk -f $1 | grep -i '\.(jpe?g|png|webp|mp4|webm)$'} + +>$1/index.html { + title=`{entitle $1 | sed 's/\./ /g'} + [^<]*)/\1 - '^$"title^'/' + cat tpl/menu + echo '

'^$"title^'

' + echo '' + cat tpl/feet +} -- cgit v1.2.3