Update website generation
This commit is contained in:
33
Makefile
33
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;
|
||||
|
||||
Reference in New Issue
Block a user