X-Git-Url: https://git.sommitrealweird.co.uk/bpgallery.git/blobdiff_plain/a67b3abbb4fd9278ad09525f0b85de4c28ab4633..b53a01a10ef10a699efae79e7b44d4e8d62eedd5:/bpgallery.sh diff --git a/bpgallery.sh b/bpgallery.sh index abcfafa..6315821 100755 --- a/bpgallery.sh +++ b/bpgallery.sh @@ -19,7 +19,7 @@ set -f -VERSION="1.0.1+arch" +VERSION="1.0.2+arch" function bpgallery_default_head() { cat </dev/null fi +if [[ -e $1 && -d $1 && -e $1/.bpgallery.rc ]]; then + . $1/.bpgallery.rc 2>/dev/null +fi + if [[ -z ${BPGALLERY_THEME} ]]; then BPGALLERY_THEME=default fi @@ -330,13 +334,19 @@ else fi +$ECHOCOMMAND "Starting to generate page" + $BPGALLERY_HEAD_FUNCTION > index.html $BPGALLERY_DESCRIPTION_FUNCTION >> index.html +$ECHOCOMMAND "Adding Captions" + $FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 --replace $ECHOCOMMAND {} |$SORTCOMMAND -g | while read filename; do filename=${filename#./}; if [ -r captions.txt ]; then caption=$($GREPCOMMAND -E "^$filename " captions.txt); caption=${caption#* }; else caption=""; fi; filename=$(bpgallery_escape_url "$filename"); $BPGALLERY_THUMBSLINE_FUNCTION; done >> index.html $BPGALLERY_TAIL_FUNCTION >> index.html +$ECHOCOMMAND "Finished generating the page" +$ECHOCOMMAND "Generating stylesheet" cd icons MAXHEIGHT=$($FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 $IDENTIFYCOMMAND -format "%h\n" | $GREPCOMMAND -v "^$" | $SORTCOMMAND -g -r | $HEADCOMMAND -n 1) @@ -349,3 +359,4 @@ MAXHEIGHT=$((MAXHEIGHT+$CAPTIONHEIGHT)) $BPGALLERY_STYLESHEET_FUNCTION > style.css +$ECHOCOMMAND "All done"