summary refs log tree commit diff
path: root/www/photo.causal.agency/generate.sh
diff options
context:
space:
mode:
Diffstat (limited to 'www/photo.causal.agency/generate.sh')
-rw-r--r--www/photo.causal.agency/generate.sh23
1 files changed, 21 insertions, 2 deletions
diff --git a/www/photo.causal.agency/generate.sh b/www/photo.causal.agency/generate.sh
index 97a2947f..83a3128b 100644
--- a/www/photo.causal.agency/generate.sh
+++ b/www/photo.causal.agency/generate.sh
@@ -36,6 +36,7 @@ encode() {
 
 page_title() {
 	case $1 in
+		(leader) echo 'Film Leader';;
 		(20*) date -j -f '%F' $1 '+%B %e, %Y';;
 		(0*) echo Roll $(dc -e "${1}p");;
 	esac
@@ -44,7 +45,7 @@ page_title() {
 page_head() {
 	local page=$1
 	local title=$(page_title $page)
-	local date body lens film
+	local date body lens film note
 
 	if test -f $page/date; then
 		date=$(sed 's/\([0-9]\)-\([0-9]\)/\1–\2/g' $page/date | encode)
@@ -75,6 +76,9 @@ page_head() {
 	if test -f $page/film; then
 		film=$(encode $page/film)
 	fi
+	if test -f $page/note; then
+		note=$(encode $page/note)
+	fi
 
 	cat <<-EOF
 	<!DOCTYPE html>
@@ -90,7 +94,8 @@ page_head() {
 	details { max-width: 78ch; margin: 0.5em auto; }
 	</style>
 	<h1>${title}</h1>
-	<p>${date:+📆 }${date:-} 📷 ${body:-}${body:+ 🔘 }${lens}${film:+ 🎞️ }${film:-}</p>
+	<p>${date:+📆 }${date:-} 📷 ${body:-}${body:+ 🔘 }${lens:-}${film:+ 🎞️ }${film:-}</p>
+	${note:+<p>}${note:-}${note:+</p>}
 	EOF
 }
 
@@ -248,6 +253,20 @@ for entry in 20* 0*; do
 	set -- $entry "$@"
 done
 
+mkdir -p static/leader
+page=static/leader/index.html
+if [ leader -nt $page ]; then
+	echo $page >&2
+	page_head leader >$page
+	for photo in leader/*.[Jj][Pp][Gg]; do
+		preview=$(preview $photo)
+		if ! test -f static/${photo}; then
+			ln $photo static/${photo}
+		fi
+		page_photo $photo $preview xxx >>$page
+	done
+fi
+
 echo static/index.html >&2
 index_head >static/index.html
 echo static/feed.atom >&2