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.sh26
1 files changed, 20 insertions, 6 deletions
diff --git a/www/photo.causal.agency/generate.sh b/www/photo.causal.agency/generate.sh
index fbc3efd6..be673790 100644
--- a/www/photo.causal.agency/generate.sh
+++ b/www/photo.causal.agency/generate.sh
@@ -41,8 +41,11 @@ page_title() {
 page_head() {
 	local date=$1
 	local title=$(page_title $date)
-	local lens film
+	local body lens film
 
+	if test -f $date/body; then
+		body=$(encode $date/body)
+	fi
 	if test -f $date/lens; then
 		lens=$(encode $date/lens)
 	else
@@ -75,7 +78,7 @@ page_head() {
 	details { max-width: 78ch; margin: 0.5em auto; }
 	</style>
 	<h1>${title}</h1>
-	<p>๐Ÿ“ท ${lens}${film:+ ๐ŸŽž๏ธ }${film:-}</p>
+	<p>๐Ÿ“ท ${body:-}${body:+ ยท }${lens}${film:+ ๐ŸŽž๏ธ }${film:-}</p>
 	EOF
 }
 
@@ -101,14 +104,21 @@ photo_id() {
 
 page_photo() {
 	local photo=$1 preview=$2 description=$3
-	if ! test -f $description; then
-		description=/dev/null
-	fi
 	photo_info $photo
 	cat <<-EOF
 	<figure id="$(photo_id $photo)">
 		<a href="${photo##*/}">
+	EOF
+	if test -f $description; then
+		cat <<-EOF
 			<img src="../${preview}" alt="$(encode $description)">
+		EOF
+	else
+		cat <<-EOF
+			<img src="../${preview}">
+		EOF
+	fi
+	cat <<-EOF
 		</a>
 		<figcaption>
 	EOF
@@ -120,11 +130,15 @@ page_photo() {
 			${PhotographicSensitivity} ISO
 		EOF
 	fi
-	cat <<-EOF
+	if test -f $description; then
+		cat <<-EOF
 			<details>
 				<summary>description</summary>
 				$(encode $description)
 			</details>
+		EOF
+	fi
+	cat <<-EOF
 		</figcaption>
 	</figure>
 	EOF