diff --git a/pages/photos.sh b/pages/photos.sh index dcc8e5a..6e87a93 100755 --- a/pages/photos.sh +++ b/pages/photos.sh @@ -131,13 +131,15 @@ function build_album_pages { fi ## Put in the subpage HTML ## - # Set the count if this is the first loop. + new_row="\t\t
" + # Set the count and start a row if this is the first loop. if [[ -z $count ]]; then count=0 - fi - # Add a row for the next 2 images. - if (( $count % 2 == 0 )); then - echo -e "\t\t
" >> $subpage + echo -e "$newrow" >> $subpage + # Else check if we need to start a new one for the next 2 images. + elif (( $count % 2 == 0 )); then + echo -e "\t\t
" >> $subpage + echo -e "$newrow" >> $subpage fi # Add the container for the image and its text. echo -e "\t\t\t
" >> $subpage @@ -160,10 +162,6 @@ function build_album_pages { fi # Close the image description and its link. echo -e "

\n\t\t\t\t\n\t\t\t
" >> $subpage - # Close the row after an odd count. - if (( $count % 2 == 1 )); then - echo -e "\t\t
" >> $subpage - fi count=$(( count + 1 )) done echo -e "\t\t" >> $subpage