diff --git a/app/decorators/posts/decorator.rb b/app/decorators/posts/decorator.rb index 638f392..a616121 100644 --- a/app/decorators/posts/decorator.rb +++ b/app/decorators/posts/decorator.rb @@ -50,6 +50,10 @@ module Adamantium truncate_html(content, 140, true) end + def permalink + "#{Hanami.app.settings.micropub_site_url}/post/#{slug}" + end + private def truncate_html(content, len = 30, at_end = nil) diff --git a/app/templates/posts/show.html.slim b/app/templates/posts/show.html.slim index 650291e..68f4cea 100644 --- a/app/templates/posts/show.html.slim +++ b/app/templates/posts/show.html.slim @@ -1,25 +1,33 @@ -div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" - h1 = post.display_title +article class="h-entry" + div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" + a class="u-url" href=post.permalink + h1 class="p-name" = post.display_title -article class="h-entry mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200 prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline prose-img:rounded" - - if post.photos? - - post.photos.each do |photo| - figure - img src=photo["value"] alt=photo["alt"] - figcaption - = photo["alt"] - == post.content + article class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200 prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline prose-img:rounded" + - if post.photos? + - post.photos.each do |photo| + figure + img src=photo["value"] alt=photo["alt"] + figcaption + = photo["alt"] + div class="e-content" + == post.content -div class="mb-4 max-w-screen-md mx-auto border-t-4 border-solid border-gray-400 dark:border-gray-600" + 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" - div class="" - = "Published #{post.display_published_at}" - span class="text-right flex-1" - == render :tags, tags: post.tags -div class="mb-2 max-w-prose mx-auto text-gray-600 dark:text-gray-200 flex" - - if post.syndicated? - span Also on:  - - post.syndicated_to.each do |loc| - a href=loc[:url] - == render loc[:location] + div class="max-w-prose mx-auto text-gray-600 dark:text-gray-200 flex" + div class="" + = "Published " + time class="dt-published" datetime=post.published_at + = post.display_published_at + p + a class="p-author h-card" href=Hanami.app.settings.micropub_site_url + = "by #{Hanami.app.settings.site_name}" + span class="text-right flex-1" + == render :tags, tags: post.tags + div class="mb-2 max-w-prose mx-auto text-gray-600 dark:text-gray-200 flex" + - if post.syndicated? + span Also on:  + - post.syndicated_to.each do |loc| + a rel="syndication" class="u-syndication" href=loc[:url] + == render loc[:location] diff --git a/app/templates/shared/_tags.html.slim b/app/templates/shared/_tags.html.slim index 07787e6..47b4a70 100644 --- a/app/templates/shared/_tags.html.slim +++ b/app/templates/shared/_tags.html.slim @@ -4,5 +4,5 @@ = "Tagged: " - tags.each do |tag| span - a class="rounded p-1 mr-1 text-xsm u-url bg-yellow-200/60 hover:bg-yellow-200 dark:bg-yellow-400 dark:hover:bg-yellow-400/80 dark:text-yellow-800 dark:hover:text-yellow-100 text-gray-600" href="/tagged/#{tag.slug}" + a class="p-category rounded p-1 mr-1 text-xsm u-url bg-yellow-200/60 hover:bg-yellow-200 dark:bg-yellow-400 dark:hover:bg-yellow-400/80 dark:text-yellow-800 dark:hover:text-yellow-100 text-gray-600" href="/tagged/#{tag.slug}" = tag.label