PhotoGallery/Events/1207Castor2GolemTransport/CreatePageFromPhotos.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

echo -e "---\nformat:markdown\ntoc:no\n..." > index.page;
mkdir originals;
mv *.JPG originals/;
mkdir icons150; 
for i in originals/*.JPG; do 
echo icon $i;  convert -resize 150 $i icons150/`basename $i`; 
echo -e '[![]('icons150/`basename $i`')](#'`basename $i|awk '{print tolower($0)}'`')' >> index.page; 
done;
echo -e "\n* [Originals](originals/)\n* [Resized](resized800/)\n* [Icons](icons150/)\n\n">>index.page ;
mkdir resized800; 
for i in originals/*.JPG; do 
echo resized 800 $i;  convert -resize 800 $i resized800/`basename $i`; 
echo -e '\n##'`basename $i`'\n\n[![]('resized800/`basename $i`')]('`basename $i`')\n\n' >> index.page; 
done;
echo -e '[code used](CreatePageFromPhotos.sh)' >> index.page;
cat index.page; git add .; git commit -m "Photogallery created `basename $PWD`"