Add heading above past posts

This commit is contained in:
2023-07-01 21:40:27 +10:00
parent 1a0a73e0be
commit 94cd60d852

View File

@@ -62,14 +62,16 @@ article class="h-entry"
img class="rounded hover:opacity-80" src=movie.poster img class="rounded hover:opacity-80" src=movie.poster
figcaption= movie.title figcaption= movie.title
hr hr
- if text_posts.count > 0 - if text_posts.count > 0 || photo_posts.count > 0
div class="block grow bg-blue-100 dark:bg-blue-600 rounded px-4 py-2 mb-12" div class="max-w-prose mx-auto text-gray-600 dark:text-gray-200 mb-4"
p class="text-sm mb-0" This week, years ago h2 class="text-sm mb-0" This week, years ago
ul class="mt-0" - if text_posts.count > 0
- text_posts.each do |past_post| div class="block grow bg-blue-100 dark:bg-blue-600 rounded px-4 py-2 mb-12"
li class="m-0" ul class="mt-0"
a class="hover:underline" href=past_post.permalink - text_posts.each do |past_post|
= "#{past_post.display_title} (#{past_post.published_at.year})" li class="m-0"
a class="hover:underline" href=past_post.permalink
= "#{past_post.display_title} (#{past_post.published_at.year})"
div class="max-w-prose mx-auto text-gray-600 dark:text-gray-200 flex" div class="max-w-prose mx-auto text-gray-600 dark:text-gray-200 flex"
- photo_posts.group_by{ |p| p.published_at.year }.each do |year, posts| - photo_posts.group_by{ |p| p.published_at.year }.each do |year, posts|