diff options
| author | Paul Buetow <paul@buetow.org> | 2022-03-05 11:48:50 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2022-03-05 11:48:50 +0000 |
| commit | e044cd54a39f38526ba7ed986df56ab2973e0329 (patch) | |
| tree | be3be0659180f8dc8bab064084a3a262c0abfc59 | |
| parent | fad3ea8d270527bd9728363614ac72aeb087e9f2 (diff) | |
add SHUFFLE option
| -rw-r--r-- | .version | 2 | ||||
| -rw-r--r-- | changelog | 6 | ||||
| -rw-r--r-- | share/templates/default/header.tmpl | 14 | ||||
| -rw-r--r-- | src/photoalbum.default.conf | 2 | ||||
| -rwxr-xr-x | src/photoalbum.sh | 11 |
5 files changed, 26 insertions, 9 deletions
@@ -1 +1 @@ -0.5.0 +0.5.1 @@ -1,3 +1,9 @@ +photoalbum (0.5.1) unstable; urgency=low + + * Minor changes + + -- Paul Buetow <paul@buetow.org> Tue, 22 Feb 2022 14:37:01 +0000 + photoalbum (0.5.0) stable; urgency=low * Major code refactoring diff --git a/share/templates/default/header.tmpl b/share/templates/default/header.tmpl index 4364ddd..c0c7c21 100644 --- a/share/templates/default/header.tmpl +++ b/share/templates/default/header.tmpl @@ -60,12 +60,14 @@ cat <<END </head> <body> +END + +if [ "${show_header_bar}" = 'yes' ]; then +cat <<END <div class="header"> - <div> - Site generated at $(date) with <a href="https://codeberg.org/foozone/photoalbum">codeberg.org/foozone/photoalbum</a> - - - © by Paul Buetow - </div> - <div>${GOTO_OVERVIEW}</div> + Site generated at $(date) with <a href="https://codeberg.org/foozone/photoalbum">codeberg.org/foozone/photoalbum</a> + - + © by Paul Buetow </div> END +fi diff --git a/src/photoalbum.default.conf b/src/photoalbum.default.conf index 51cf886..51b2118 100644 --- a/src/photoalbum.default.conf +++ b/src/photoalbum.default.conf @@ -7,6 +7,8 @@ THUMBHEIGHT=300 HEIGHT=1200 # Max previews per page. MAXPREVIEWS=40 +# Randomly shuffle all previews. +# SHUFFLE=yes # Diverse directories, need to be full paths, not relative! INCOMING_DIR=$(pwd)/incoming diff --git a/src/photoalbum.sh b/src/photoalbum.sh index 31c96fb..0f4e0f6 100755 --- a/src/photoalbum.sh +++ b/src/photoalbum.sh @@ -89,6 +89,14 @@ animate-zoom END } +maybe_shuffle () { + if [ "$SHUFFLE" = yes ]; then + sort -R + else + sort + fi +} + albumhtml () { declare photos_dir="$1" ; shift declare html_dir="$1" ; shift @@ -98,7 +106,6 @@ albumhtml () { declare -i num=1 declare -i i=0 - declare name="page-$num" # Random background image for preview page. @@ -106,7 +113,7 @@ albumhtml () { export show_header_bar='yes' template 'header' "$name.html" - cd "$DIST_DIR/$photos_dir" && find ./ -type f | sort | sed 's;^\./;;' | + cd "$DIST_DIR/$photos_dir" && find ./ -type f | maybe_shuffle | sed 's;^\./;;' | while read -r photo; do let i++ |
