Show number of posts per year
This commit is contained in:
@@ -59,7 +59,10 @@ div class="max-w-screen-md mx-auto px-4 m-4 h-max"
|
|||||||
div class=""
|
div class=""
|
||||||
- posts_by_month.each do |year, months|
|
- posts_by_month.each do |year, months|
|
||||||
div class="text-center"
|
div class="text-center"
|
||||||
h3 class="my-4" = year
|
div class="my-4"
|
||||||
|
h3 class="m-0" = year
|
||||||
|
small class="text-sm"
|
||||||
|
= "#{months.values.flatten.map(&:values).flatten.sum} posts"
|
||||||
div class="text-sm flex justify-between"
|
div class="text-sm flex justify-between"
|
||||||
div Jan
|
div Jan
|
||||||
div Feb
|
div Feb
|
||||||
@@ -73,8 +76,7 @@ div class="max-w-screen-md mx-auto px-4 m-4 h-max"
|
|||||||
div Oct
|
div Oct
|
||||||
div Nov
|
div Nov
|
||||||
div Dec
|
div Dec
|
||||||
div class="grid grid-rows-7 grid-flow-col gap-0.5 col-start-2"
|
div class="grid grid-rows-7 grid-flow-col gap-0.5 col-start-2"
|
||||||
- months.each do |month, days|
|
- months.each do |month, days|
|
||||||
- days.each do |day, post_count|
|
- days.each do |day, post_count|
|
||||||
a class="group block h-2.5 w-2.5 #{post_count == 0 ? "bg-gray-50 dark:bg-indigo-800" : "bg-pink-600 dark:bg-amber-400 hover:bg-pink-800 hover:dark:bg-amber-200"}" style="opacity: #{post_count == 0 ? 1.0 : post_count.to_f / days.values.max}" href="/timemachine/#{year}/#{month}/#{day}"
|
a class="group block h-2.5 w-2.5 #{post_count == 0 ? "bg-gray-50 dark:bg-indigo-800" : "bg-pink-600 dark:bg-amber-400 hover:bg-pink-800 hover:dark:bg-amber-200"}" style="opacity: #{post_count == 0 ? 1.0 : post_count.to_f / days.values.max}" href="/timemachine/#{year}/#{month}/#{day}"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user