diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rwxr-xr-x | photoalbum.sh | 11 |
2 files changed, 9 insertions, 4 deletions
@@ -7,4 +7,4 @@ dist: rm -Rf dist 2>/dev/null mkdir dist mv thumbs html photos dist - cp index.html dist + mv index.html ./dist diff --git a/photoalbum.sh b/photoalbum.sh index 1658a48..b263f41 100755 --- a/photoalbum.sh +++ b/photoalbum.sh @@ -14,11 +14,16 @@ function createdirs () { function template () { local -r template=$1 local -r html=$2 + local destdir=$3 + + if [ -z "$destdir" ]; then + destdir=html/ + fi if [ -d ./templates/ ]; then - source ./templates/${template}.tmpl >> ./html/${html}.html + source ./templates/${template}.tmpl >> ./${destdir}/${html}.html else - source ../templates/${template}.tmpl >> ../html/${html}.html + source ../templates/${template}.tmpl >> ../${destdir}/${html}.html fi } @@ -112,5 +117,5 @@ function generate () { createdirs scale find ./html -type f -name \*.html -delete -cd html && template index index && cd .. generate 1 +template index index . |
