diff options
author | June McEnroe <june@causal.agency> | 2024-06-09 18:48:15 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2024-06-09 18:48:15 -0400 |
commit | 2df9d0291f9451fd603f102778abf64a4d62f977 (patch) | |
tree | c50ce269f99e580e3529ca2b8bc0a0420d991d86 /www | |
parent | Remove use of sysexits.h (diff) | |
download | src-2df9d0291f9451fd603f102778abf64a4d62f977.tar.gz src-2df9d0291f9451fd603f102778abf64a4d62f977.zip |
Put lens and (future) film at the tops of photo pages
Diffstat (limited to '')
-rw-r--r-- | www/photo.causal.agency/generate.sh | 22 |
1 files changed, 22 insertions, 0 deletions
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 <!DOCTYPE html> <meta charset="utf-8"> @@ -49,11 +69,13 @@ page_head() { <title>${title}</title> <style> html { color: #bbb; background-color: black; font-family: sans-serif; } + p { text-align: center; } figure { margin: 1em; padding-top: 0.5em; text-align: center; } img { max-width: calc(100vw - 2.5em); max-height: calc(100vh - 2.5em); } details { max-width: 78ch; margin: 0.5em auto; } </style> <h1>${title}</h1> + <p>📷 ${lens}${film:+ 🎞️ }${film:-}</p> EOF } |