From 2df9d0291f9451fd603f102778abf64a4d62f977 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sun, 9 Jun 2024 18:48:15 -0400 Subject: Put lens and (future) film at the tops of photo pages --- www/photo.causal.agency/generate.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'www') diff --git a/www/photo.causal.agency/generate.sh b/www/photo.causal.agency/generate.sh index 4b30db92..4cbee3f6 100644 --- a/www/photo.causal.agency/generate.sh +++ b/www/photo.causal.agency/generate.sh @@ -41,6 +41,26 @@ page_title() { page_head() { local date=$1 local title=$(page_title $date) + local lens film + + if test -f $date/lens; then + lens=$(encode $date/lens) + else + lens=$( + identify -format '%[EXIF:LensModel]' \ + $date/$(ls -1 $date | head -n 1) 2>/dev/null | + sed ' + s/\([A-Z]\)\([0-9]\)/\1 \2/ + s,f/,ƒ/, + s/\([0-9]\)-\([0-9]\)/\1–\2/g + ' | + encode + ) + fi + if test -f $date/film; then + film=$(encode $date/film) + fi + cat <<-EOF @@ -49,11 +69,13 @@ page_head() { ${title}

${title}

+

📷 ${lens}${film:+ 🎞️ }${film:-}

EOF } -- cgit 1.4.1