#!/bin/bash # Directory where images are stored IMAGE_DIR="../../assets/pics/gallery/classic" OUTPUT_FILE="index.html" # Ensure the images directory exists if [ ! -d "$IMAGE_DIR" ]; then echo "Error: Directory '$IMAGE_DIR' not found!" exit 1 fi # Start writing the HTML file cat > "$OUTPUT_FILE" < Beach Party Balloons - Gallery

Classic Balloon Décor

EOL # Add lightbox overlays with captions count=1 for img in "$IMAGE_DIR"/*.{jpg,jpeg,png,gif,webp}; do if [[ -f "$img" ]]; then filename=$(basename "$img") caption_file="${img%.*}.txt" if [[ -f "$caption_file" ]]; then caption=$(cat "$caption_file") else caption="" fi echo "
" >> "$OUTPUT_FILE" # echo " ×" >> "$OUTPUT_FILE" echo "
\"$caption\"
" >> "$OUTPUT_FILE" echo "

$caption

" >> "$OUTPUT_FILE" echo "
" >> "$OUTPUT_FILE" count=$((count+1)) fi done # Finish the HTML file cat >> "$OUTPUT_FILE" <
Copyright © Beach Party Balloons All images & content are property of Beach Party Balloons. Use of images without written permission is prohibited.
EOL echo "Gallery generated with captions! Open $OUTPUT_FILE in your browser."