diff --git a/Makefile b/Makefile index eb81376..010c0f4 100644 --- a/Makefile +++ b/Makefile @@ -8,33 +8,38 @@ REMOTE = sdk@codevoid.de:/home/www/htdocs/shagen all: build-and-upload-all @echo "done." -# Create the photo galleries and create the index and preview html -# pages in site/, so they get parsed in the compile step +# Create the photo galleries and create the index and preview html pages. PHOTODIRS != find photos/* -maxdepth 0 -mindepth 0 -type d photos: ${PHOTODIRS} mkdir -p ${SITE}/photos cd photos && sh ${SCRIPTS}/mkphotoindex.sh > index.html - find photos -type f -not -name "*.html" -exec install -D {} www/{} \; - find photos -type f -name "*.html" -exec install -D {} site/{} \; + find photos -type f \( -not -name "*.html" \ + -not -name "*.txt" \ + -not -name "*.meta" \ + \) -exec install -D {} www/{} \; + find photos -type f \( -name "*.html" \ + -o -name "*.meta" \ + \) -exec install -D {} site/{} \; +${PHOTODIRS}: + cd "$@" && sh ${SCRIPTS}/mkphotos.sh > index.html +# (manual step) - it takes some time to optimize all images and it's not really necessary. optimize: find photos -name "*.jpg" -type f -exec jpegoptim -w 12 --all-progressive --strip-all "{}" + +# create the uugrn test calendar calendar: mkdir -p ${SITE}/uugcal cd ${SITE}/uugcal && sh ${SCRIPTS}/mkuugcalendar.sh > index.html -${PHOTODIRS}: - cd "$@" && sh ${SCRIPTS}/mkphotos.sh > index.html - # invoke zod and compile the website into the www/ dir compile: mkdir -p ${WWW} zod ${SITE} ${WWW} # after mixing different generators in the compile step, let's tidy and -# indent the output properly (XXX is there a tool that does _only_ -# indent?) +# indent the output properly. XXX is there a tool that does _only_ +# indent? We don't need all the other tidy magic here... tidy: find ${WWW} -type f -name "*.html" \ -exec tidy -q -i -m -c -w 120 -f /dev/null {} \; @@ -54,17 +59,13 @@ fixperms: doas chmod -R ugo+wrX,go-w ${WWW} # we can upload to the local and the remote webserver at the same time -upload-local: stagit +upload-local: doas rsync -a --delete ${WWW}/ ${LOCAL}/ -upload-remote: stagit +upload-remote: doas rsync -a --delete -e ssh ${WWW}/ ${REMOTE}/ upload-all: upload-local upload-remote -build: - make clean; \ - make photos; \ - make stagit; \ - make calendar; \ +build: photos calendar stagit make compile; \ make tidy; \ make fixperms; diff --git a/scripts/mkphotos.sh b/scripts/mkphotos.sh index 77d2000..4b26895 100644 --- a/scripts/mkphotos.sh +++ b/scripts/mkphotos.sh @@ -59,12 +59,12 @@ do then echo "

$TITLE

" > "${_file_html}" echo "

File: ${_file} (Open Original)

" >> "${_file_html}" - echo "

" >> "${_file_html}" + echo "

\"Preview

" >> "${_file_html}" [ -f "${_file_descr}" ] && cat "${_file_descr}" >> "${_file_html}" echo "

Back to Index

" >> "${_file_html}" fi - echo "" + echo "\"Thumbnail" if [ $(( _count % 3 )) -eq 0 ] then echo "" diff --git a/scripts/reposync.sh b/scripts/reposync.sh index 9a098cb..88b977b 100755 --- a/scripts/reposync.sh +++ b/scripts/reposync.sh @@ -13,7 +13,7 @@ add_repo() {( mkdir -p www/code/${_dir} cp site/code/*.{css,png} www/code/${_dir}/ cd www/code/${_dir} - stagit -u https://stefanhagen.de/code ${_fulldir} + stagit -u https://stefanhagen.de/code/ -l 100 ${_fulldir} )} mkdir -p code