From 55742e50db0ea9fceedaecee70663e9a0716fed5 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 27 May 2025 10:51:41 -0700 Subject: [PATCH] Remove the `all` folder in place of an `all.html` file. Create a main page which provides the output of it. --- files/photos/README.md | 8 +++++++- files/photos/all/README.md | 3 --- pages/photos-all.sh | 20 ++++++++++++++++++++ pages/photos.sh | 6 +++--- 4 files changed, 30 insertions(+), 7 deletions(-) delete mode 100644 files/photos/all/README.md create mode 100755 pages/photos-all.sh diff --git a/files/photos/README.md b/files/photos/README.md index 118a7ff..4bc762a 100644 --- a/files/photos/README.md +++ b/files/photos/README.md @@ -1,3 +1,9 @@ # Hyperling.com - files/photos/ -Used by `http://localhost:8080/photos` to build albums for sharing. +## index.html + +Used by `http://localhost:8080/photos` to build and show list of albums. + +## all.html + +Used by `http://localhost:8080/photos-all` to show all albums at once. diff --git a/files/photos/all/README.md b/files/photos/all/README.md deleted file mode 100644 index 6f2bbc2..0000000 --- a/files/photos/all/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Hyperling.com - files/photos/all/ - -Used by `http://localhost:8080/photos` to show all albums at once. diff --git a/pages/photos-all.sh b/pages/photos-all.sh new file mode 100755 index 0000000..68024a8 --- /dev/null +++ b/pages/photos-all.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Alias for new All Photos feed. + +# Move to main directory. +DIR=`dirname $0` +cd $DIR/.. + +# Locations of photo scripts. +photos_all=./files/photos/all.html +photos=./pages/photos.sh + +# If the all script does not exist,call the generator and ignore its output. +if [[ ! -e $photos_all ]]; then + $photos > /dev/null +fi + +## Main ## +cat $photos_all + +exit 0 diff --git a/pages/photos.sh b/pages/photos.sh index 6bab140..b0a1706 100755 --- a/pages/photos.sh +++ b/pages/photos.sh @@ -19,7 +19,7 @@ cd $DIR/.. HELPER_DIR=./pages/helpers PHOTOS_DIR=./files/photos mainpage=$PHOTOS_DIR/index.html -allpage=$PHOTOS_DIR/all/index.html +allpage=$PHOTOS_DIR/all.html # Use the cached version if available. if [[ -e $mainpage ]]; then @@ -49,7 +49,7 @@ function start_main_page { echo -e "\t\t" >> $mainpage echo -e "\t\t
" >> $mainpage - echo -e "\t\t\t<$a href='/files/photos/all/index.html'" >> $mainpage + echo -e "\t\t\t<$a href='/photos-all'" >> $mainpage echo -e "\t\t\t\tclass='col-12 header'>Click Here for the Full Image Feed" >> $mainpage echo -e "\t\t\t" >> $mainpage echo -e "\t\t
" >> $mainpage @@ -194,7 +194,7 @@ function build_all_page { # Add header. echo -e "\t\t
" >> $allpage - echo -e "\t\t\t

All Image Feed

" >> $allpage + echo -e "\t\t\t

All Photo Feed

" >> $allpage echo -e "\t\t
" >> $allpage # Add images to the page