diff --git a/config.yaml b/config.yaml index d1c7d47..432480e 100644 --- a/config.yaml +++ b/config.yaml @@ -5,6 +5,8 @@ disableHugoGeneratorInject: true enableRobotsTXT: false params: + picturesBase: "/pictures" + thumbBase: "/pictures/thumb" sourceURL: "https://git.tobast.fr/tobast/georges" siteLicenseURL: "https://www.gnu.org/licenses/gpl-3.0.en.html" siteLicenseName: "GNU GPLv3" @@ -40,6 +42,11 @@ module: target: i18n - source: archetypes target: archetypes + # Georges + - source: pictures/full + target: static/pictures + - source: pictures/thumb + target: static/pictures/thumb # Blueimp Gallery - source: contrib/blueimp-gallery/css target: static/blueimp/css diff --git a/content/_index.md b/content/_index.md index af5ac4e..00f9285 100644 --- a/content/_index.md +++ b/content/_index.md @@ -8,26 +8,26 @@ georgespics: osm: https://www.openstreetmap.org/#map=14/45.1612/5.9444 date: 2021-06-27 pics: - - path: img/georges/2021-06-pra1.jpg - - path: img/georges/2021-06-pra2.jpg - - path: img/georges/2021-06-pra3.jpg - - path: img/georges/2021-06-pra4.jpg + - path: 2021-06-pra1.jpg + - path: 2021-06-pra2.jpg + - path: 2021-06-pra3.jpg + - path: 2021-06-pra4.jpg - name: Pen-Bé, Bretagne osm: https://www.openstreetmap.org/#map=14/47.4205/-2.4575 date: 2021-07-05 pics: - - path: img/georges/2021-07-penbe1.jpg - - path: img/georges/2021-07-penbe2.jpg + - path: 2021-07-penbe1.jpg + - path: 2021-07-penbe2.jpg - name: Mourèze, Hérault osm: https://www.openstreetmap.org/#map=15/43.6191/3.3517 date: 2021-07-27 pics: - - path: img/georges/2021-07-moureze1.jpg + - path: 2021-07-moureze1.jpg - name: Dent de Crolles, Alpes osm: https://www.openstreetmap.org/#map=15/45.3105/5.8559 date: 2021-11-13 pics: - - path: img/georges/2021-11-crolles1.jpg - - path: img/georges/2021-11-crolles2.jpg - - path: img/georges/2021-11-crolles3.jpg + - path: 2021-11-crolles1.jpg + - path: 2021-11-crolles2.jpg + - path: 2021-11-crolles3.jpg --- diff --git a/layouts/index.html b/layouts/index.html index 6352416..a2ce8ca 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -59,8 +59,8 @@ diff --git a/pictures/.gitignore b/pictures/.gitignore new file mode 100644 index 0000000..bb48e1a --- /dev/null +++ b/pictures/.gitignore @@ -0,0 +1 @@ +thumb diff --git a/pictures/Makefile b/pictures/Makefile new file mode 100644 index 0000000..d64cfeb --- /dev/null +++ b/pictures/Makefile @@ -0,0 +1,18 @@ +FULLPICS = $(wildcard full/*.jpg) +THUMBS = $(patsubst full/%.jpg,thumb/%.jpg,$(FULLPICS)) + +THUMB_DIM = 400 +THUMB_ASPECT_RATIO = 1:1 +CONVERT_OPTIONS = -quality 75 -strip -interlace Plane +repage + +all: $(THUMBS) + +thumb/%.jpg: full/%.jpg + convert "$<" \ + -resize '$(THUMB_DIM)x$(THUMB_DIM)^' \ + -gravity "$$(./gravityof.sh "$<")" \ + -crop "$(THUMB_ASPECT_RATIO)" \ + $(CONVERT_OPTIONS) "$@" + +clean: + rm -f $(THUMBS) diff --git a/static/img/georges/2021-06-pra1.jpg b/pictures/full/2021-06-pra1.jpg similarity index 100% rename from static/img/georges/2021-06-pra1.jpg rename to pictures/full/2021-06-pra1.jpg diff --git a/static/img/georges/2021-06-pra2.jpg b/pictures/full/2021-06-pra2.jpg similarity index 100% rename from static/img/georges/2021-06-pra2.jpg rename to pictures/full/2021-06-pra2.jpg diff --git a/static/img/georges/2021-06-pra3.jpg b/pictures/full/2021-06-pra3.jpg similarity index 100% rename from static/img/georges/2021-06-pra3.jpg rename to pictures/full/2021-06-pra3.jpg diff --git a/static/img/georges/2021-06-pra4.jpg b/pictures/full/2021-06-pra4.jpg similarity index 100% rename from static/img/georges/2021-06-pra4.jpg rename to pictures/full/2021-06-pra4.jpg diff --git a/static/img/georges/2021-07-moureze1.jpg b/pictures/full/2021-07-moureze1.jpg similarity index 100% rename from static/img/georges/2021-07-moureze1.jpg rename to pictures/full/2021-07-moureze1.jpg diff --git a/static/img/georges/2021-07-penbe1.jpg b/pictures/full/2021-07-penbe1.jpg similarity index 100% rename from static/img/georges/2021-07-penbe1.jpg rename to pictures/full/2021-07-penbe1.jpg diff --git a/static/img/georges/2021-07-penbe2.jpg b/pictures/full/2021-07-penbe2.jpg similarity index 100% rename from static/img/georges/2021-07-penbe2.jpg rename to pictures/full/2021-07-penbe2.jpg diff --git a/static/img/georges/2021-11-crolles1.jpg b/pictures/full/2021-11-crolles1.jpg similarity index 100% rename from static/img/georges/2021-11-crolles1.jpg rename to pictures/full/2021-11-crolles1.jpg diff --git a/static/img/georges/2021-11-crolles2.jpg b/pictures/full/2021-11-crolles2.jpg similarity index 100% rename from static/img/georges/2021-11-crolles2.jpg rename to pictures/full/2021-11-crolles2.jpg diff --git a/static/img/georges/2021-11-crolles3.jpg b/pictures/full/2021-11-crolles3.jpg similarity index 100% rename from static/img/georges/2021-11-crolles3.jpg rename to pictures/full/2021-11-crolles3.jpg diff --git a/pictures/gravity/2021-07-penbe1.gravity b/pictures/gravity/2021-07-penbe1.gravity new file mode 100644 index 0000000..077fce6 --- /dev/null +++ b/pictures/gravity/2021-07-penbe1.gravity @@ -0,0 +1 @@ +South-West diff --git a/pictures/gravityof.sh b/pictures/gravityof.sh new file mode 100755 index 0000000..33fb184 --- /dev/null +++ b/pictures/gravityof.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +path="$1" +gravity_path="gravity/$(basename "$path" .jpg).gravity" +if [ -f "$gravity_path" ]; then + read gravity < $gravity_path +fi +echo "${gravity:-center}" diff --git a/pre-build.sh b/pre-build.sh new file mode 100755 index 0000000..249048c --- /dev/null +++ b/pre-build.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +make -C pictures +make -C scss