From 7ee1cc377149c3d8fe58e67e0e67482a2ba170ec Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Mon, 18 Sep 2023 19:29:01 +1000 Subject: [PATCH] Fix tag local clash with Hanami --- app/templates/shared/_tags.html.slim | 6 +++--- app/templates/site/home.html.slim | 2 +- app/templates/tags/index.html.slim | 6 +++--- app/templates/tags/show.html.slim | 4 ++-- app/views/tags/show.rb | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/templates/shared/_tags.html.slim b/app/templates/shared/_tags.html.slim index 0d99a04..ecea26e 100644 --- a/app/templates/shared/_tags.html.slim +++ b/app/templates/shared/_tags.html.slim @@ -2,7 +2,7 @@ div class="mb-2" span class="text-sm text-gray-600 dark:text-gray-200 leading-10" = "Tagged: " - - tags.each do |tag| + - tags.each do |post_tag| span - a class="p-category rounded p-1 mr-1 text-xsm u-url bg-yellow-100/60 hover:bg-yellow-200 dark:bg-yellow-400/60 dark:hover:bg-yellow-400/80 dark:text-yellow-100 dark:hover:text-yellow-100 text-gray-600" href="/tagged/#{tag.slug}" - = tag.label + a class="p-category rounded p-1 mr-1 text-xsm u-url bg-yellow-100/60 hover:bg-yellow-200 dark:bg-yellow-400/60 dark:hover:bg-yellow-400/80 dark:text-yellow-100 dark:hover:text-yellow-100 text-gray-600" href="/tagged/#{post_tag.slug}" + = post_tag.label diff --git a/app/templates/site/home.html.slim b/app/templates/site/home.html.slim index 7be79bf..e7dba8e 100644 --- a/app/templates/site/home.html.slim +++ b/app/templates/site/home.html.slim @@ -43,7 +43,7 @@ div class="flex justify-between max-w-prose mx-auto mb-2" div class="grid grid-cols-3 gap-4 max-w-prose mx-auto" - photo_posts.each do |post| - == render "shared/photo_post", post: post + == render "shared/photo_post", post: post, extended: false - if last_location div class="mb-12 mt-6 max-w-prose mx-auto text-gray-600 dark:text-gray-200 rounded p-2 bg-blue-50 dark:bg-blue-900/60" diff --git a/app/templates/tags/index.html.slim b/app/templates/tags/index.html.slim index 0991b14..3be10ee 100644 --- a/app/templates/tags/index.html.slim +++ b/app/templates/tags/index.html.slim @@ -7,9 +7,9 @@ div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark: div h3 class="text-xl mt-6 mb-2 font-bold text-gray-800 dark:text-gray-200" = group.upcase - - tags.each do |tag| + - tags.each do |post_tag| span class="inline-block mb-2" - a class="p-category no-underline rounded p-1 mr-1 text-xsm u-url bg-yellow-100/60 hover:bg-yellow-200 dark:bg-yellow-400/60 dark:hover:bg-yellow-400/80 dark:text-yellow-50 dark:hover:text-yellow-100 text-gray-600" href="/tagged/#{tag.slug}" - = tag.label + a class="p-category no-underline rounded p-1 mr-1 text-xsm u-url bg-yellow-100/60 hover:bg-yellow-200 dark:bg-yellow-400/60 dark:hover:bg-yellow-400/80 dark:text-yellow-50 dark:hover:text-yellow-100 text-gray-600" href="/tagged/#{post_tag.slug}" + = post_tag.label div class="max-w-screen-md mx-auto border-t-4 border-solid border-gray-400 dark:border-gray-600" diff --git a/app/templates/tags/show.html.slim b/app/templates/tags/show.html.slim index 888ce32..44b56cf 100644 --- a/app/templates/tags/show.html.slim +++ b/app/templates/tags/show.html.slim @@ -1,7 +1,7 @@ -- context.content_for(:title, "Tag - #{tag.label} | ") +- context.content_for(:title, "Tag - #{post_tag.label} | ") div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" - h2 = "#{posts.count} item(s) tagged \"#{tag.label}\"" + h2 = "#{posts.count} item(s) tagged \"#{post_tag.label}\"" div class="mb-12 max-w-prose mx-auto" - posts.each do |post| diff --git a/app/views/tags/show.rb b/app/views/tags/show.rb index d234c25..4230943 100644 --- a/app/views/tags/show.rb +++ b/app/views/tags/show.rb @@ -15,7 +15,7 @@ module Adamantium end end - expose :tag do |slug:| + expose :post_tag do |slug:| tag_repo.fetch!(slug) end end