From 22c382c028fa641aeed5ca42849857efe65a0bff Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Mon, 18 Sep 2023 18:17:18 +1000 Subject: [PATCH] Updates to photo pages --- app/templates/posts/show.html.slim | 8 ++++---- app/templates/shared/_photo_post.html.slim | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/templates/posts/show.html.slim b/app/templates/posts/show.html.slim index 9919173..4092313 100644 --- a/app/templates/posts/show.html.slim +++ b/app/templates/posts/show.html.slim @@ -27,8 +27,8 @@ article class="h-entry" == post.content - if post.photos? - - post.photos.each do |photo| - figure + - post.photos.each_with_index do |photo, idx| + figure id="photo-#{idx}" img class="u-photo shadow-solid shadow-pink-100 dark:shadow-pink-200 mb-4" src=photo["value"] alt=photo["alt"] figcaption = photo["alt"] @@ -74,11 +74,11 @@ article class="h-entry" a href=movie.url figure class="w-24" img class="rounded hover:opacity-80" src=movie.poster - figcaption= movie.title + / figcaption= movie.title hr - if text_posts.count > 0 || photo_posts.count > 0 div class="max-w-prose mx-auto text-gray-600 dark:text-gray-200 mb-4" - h2 class="text-sm mb-0" This week, years ago + h3 class="text-xl mb-0" This week, years ago - if text_posts.count > 0 div class="block grow bg-blue-100 dark:bg-blue-600 rounded px-4 py-2 mb-12" ul class="mt-0" diff --git a/app/templates/shared/_photo_post.html.slim b/app/templates/shared/_photo_post.html.slim index 65d894e..057ce77 100644 --- a/app/templates/shared/_photo_post.html.slim +++ b/app/templates/shared/_photo_post.html.slim @@ -1,3 +1,4 @@ -div class="rounded max-w-xs" - a href="#{post.permalink}" - img class="rounded object-cover transition-transform ease-out hover:scale-105 h-48 w-48" src="#{post.photos[0]["value"]}" alt="#{post.photos[0]["alt"]}" +- post.photos.each_with_index do |photo, idx| + div class="rounded max-w-xs" + a href="#{post.permalink}#photo-#{idx}" + img class="rounded object-cover transition-transform ease-out hover:scale-105 h-48 w-48" src="#{photo["value"]}" alt="#{photo["alt"]}"