#!/bin/sh ## Script for generating photo gallery website ## ## Usage: ## $ ./gal [PHOTOS DIR] [OUTPUT DIR] ## === Customize === QUALITY=70 THUMBNAIL_RESOLUTION=250 RESOLUTION=1500 ## ================= PHOTOS=$1 OUTPUT=$2 mkdir -p $2/{photos,thumbs} ## Generate index.html menu file cp style.css $OUTPUT echo "Generating index.html" cat > $OUTPUT/index.html < Gallery
EOF for f in $PHOTOS/*.{jpg,JPG,jpeg,JPEG,png,PNG}; do filename=$(basename $f) [ -f $f ] && cat >> $OUTPUT/index.html < $filename
EOF done cat >> $OUTPUT/index.html < EOF ## Generate photo_list echo "Generating photo_list" [ -f $OUTPUT/photo_list ] && echo "Replacing existing photo_list" && rm $OUTPUT/photo_list for f in $PHOTOS/*.{jpg,JPG,jpeg,JPEG,png,PNG}; do filename=$(basename $f) [ -f $f ] && cat >> $OUTPUT/photo_list <