#!/bin/bash # Simple Static Gallery Generator # Generates a single-page gallery from images in the images/ directory set -e IMAGES_DIR="images" OUTPUT_DIR="output" TEMPLATES_DIR="templates" ASSETS_DIR="assets" # Load .env if present; see .env.example for every option and its default. # Precedence: command line flags > environment > .env > built-in defaults. ENV_FILE="${ENV_FILE:-.env}" if [[ -f "$ENV_FILE" ]]; then # Remember caller-supplied values so the file cannot clobber them env_override=$(export -p | grep -E '^declare -x (STRIP_EXIF|GALLERY_TITLE|SHOW_FOOTER)=' || true) # shellcheck source=/dev/null source "$ENV_FILE" if [[ -n "$env_override" ]]; then eval "$env_override" fi unset env_override fi # Image metadata (EXIF/GPS/IPTC/XMP) is stripped by default. # Opt out with STRIP_EXIF=0 or --keep-exif. STRIP_EXIF="${STRIP_EXIF:-1}" # Page title, used for both