From c6fd3f4786f6aff62658875a911d21c1af7d6798 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 26 May 2025 16:38:34 -0700 Subject: [PATCH] Finish the `all` page! Even easier than expected and works GREAT! --- pages/photos.sh | 84 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 62 insertions(+), 22 deletions(-) diff --git a/pages/photos.sh b/pages/photos.sh index f205a4a..3e6599e 100755 --- a/pages/photos.sh +++ b/pages/photos.sh @@ -6,6 +6,7 @@ DIR=`dirname $0` header="\n\t
\n\t\tALBUM\n\t
\n\t" footer="\n\t\n" +a="a target='_blank' rel='noopener noreferrer'" ## Functions ## function remove_problem_strings { @@ -48,6 +49,12 @@ function start_main_page { echo -e "video name to pull up the full resolution for download.

" >> $mainpage echo -e "\t\t\t" >> $mainpage 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\tclass='col-12 header'>Click Here for the Full Image Feed" >> $mainpage + echo -e "\t\t\t" >> $mainpage + echo -e "\t\t
" >> $mainpage } ## Close out the main page after the sub pages are done being added. ## @@ -63,7 +70,7 @@ function build_album_pages { # Display the album names descending. ls $PHOTOS_DIR/ | sort -r | while read album; do # Skip files, only read directories. - if [[ ! -d $PHOTOS_DIR/$album ]]; then + if [[ ! -d "$PHOTOS_DIR/$album" || "$album" == "all" ]]; then continue fi @@ -73,8 +80,8 @@ function build_album_pages { album_name=${album_name//-/ } echo -e "\t\t
" >> $mainpage echo -en "\t\t\t

" >> $mainpage - echo -en "> $mainpage - echo -e "target='_blank' rel='noopener noreferrer'>$album_name

" >> $mainpage + echo -en "<$a href='/files/photos/$album/index.html'>" >> $mainpage + echo -e "$album_name" >> $mainpage echo -e "\t\t
" >> $mainpage # Catch all the upcoming photo records. @@ -115,8 +122,7 @@ function build_album_pages { echo -e "\t\t\t\t

`cat $photo`

" >> $mainpage else # Otherwise put in the PHOTOS page list. - echo -en "\t\t\t\t
  • > $mainpage - echo -en "rel='noopener noreferrer'>$filename" >> $mainpage + echo -en "\t\t\t\t
  • <$a href='/$photo'>$filename" >> $mainpage if [[ $photo == *".mp4" ]]; then echo -en " [VIDEO]" >> $mainpage fi @@ -134,8 +140,7 @@ function build_album_pages { fi # Add the container for the image and its text. echo -e "\t\t\t
    " >> $subpage - echo -en "\t\t\t\t> $subpage - echo -e "rel='noopener noreferrer'>" >> $subpage + echo -en "\t\t\t\t<$a href='/$photo'>" >> $subpage # Determine what type of media it is, and how to display it. if [[ $photo == *".mp4" ]]; then echo -e "\t\t\t\t\t
    " >> $allpage + echo -e "\t\t
    " >> $allpage fi # Add a column. - echo "
    " >> $allpage + echo -e "\t\t\t
    " >> $allpage # Add the image. - echo "$media" >> $allpage + echo -e "\t\t\t\t
    " >> $allpage + echo -e "\t\t\t\t\t<$a href='$media_uri'>$media" >> $allpage + echo -e "\t\t\t\t
    " >> $allpage # Add the URLs. - echo "$media_name" >> $allpage + echo -e "\t\t\t\t
    " >> $allpage + echo -e "\t\t\t\t\t

    <$a href='$dir_uri'>$dir_name

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

    <$a href='$media_uri'>$media_name

    " >> $allpage + echo -e "\t\t\t\t
    " >> $allpage # Close the column. - echo "
    " >> $allpage + echo -e "\t\t\t
    " >> $allpage # Close the row and reset the the count if full. if [[ $count == 3 ]]; then - echo "
    " >> $allpage + echo -e "\t\t
    " >> $allpage count=0 + else + count=$(( count + 1 )) fi done