diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2017-01-24 09:06:10 -0500 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2017-01-24 09:06:10 -0500 |
commit | aa849d9eeae23eb7380d3152eece7c551f447779 (patch) | |
tree | b8c0b41b450cf2054d82ed3fab3668c80b6db70f | |
parent | f0e8ac47bc52d40099cc0adc486cd1cbf395a339 (diff) |
Add support for images.
-rwxr-xr-x | publish.sh | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -16,3 +16,22 @@ for input in ${INPUTS}; do mkdir -p $(dirname "$output") perl -pe "$filter" "$input" | pandoc -f org -s -t html5 -H static/header-ext.html -o "$output" done + +mkdir -p www/images +IMAGES=$(find input -regextype awk -iregex '.*\.(jpg|png)') +for image in ${IMAGES}; do + tmp="www${image#input}" + basepath=${tmp%.*} + extension=${image#*.} + + if [[ ! -f "${basepath}.${extension}" ]]; then + cp -v $image "${basepath}.${extension}" + fi + + for res in 640 1024 2048; do + target="${basepath}-${res}w.${extension}" + if [[ ! -f $target ]]; then + convert $image -resize $res $target + fi + done +done |