Allow extended photo posts

This commit is contained in:
2023-09-18 19:29:38 +10:00
parent 7ee1cc3771
commit c11bb56ebe
3 changed files with 10 additions and 5 deletions

View File

@@ -5,6 +5,6 @@ div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:
div class="grid grid-cols-3 gap-4 mb-4 max-w-prose mx-auto"
- photos.each do |post|
== render "shared/photo_post", post: post
== render "shared/photo_post", post: post, extended: true
div class="max-w-screen-md mx-auto border-t-4 border-solid border-gray-400 dark:border-gray-600"

View File

@@ -94,7 +94,7 @@ article class="h-entry"
= year
div class="grid grid-cols-3 gap-4 mb-4 max-w-prose mx-auto"
-posts.each do |post|
== render "shared/photo_post", post: post
== render "shared/photo_post", post: post, extended: false
div class="mb-4 max-w-screen-md mx-auto border-t-4 border-solid border-gray-400 dark:border-gray-600"
div class="max-w-prose mx-auto text-gray-600 dark:text-gray-200 flex"

View File

@@ -1,4 +1,9 @@
- post.photos.each_with_index do |photo, idx|
- if extended
- 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"]}"
- else
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"]}"
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"]}"