Add more microformat tags

This commit is contained in:
2023-02-13 09:33:27 +11:00
parent 0dc7ee25bf
commit 71ec805cd3
3 changed files with 35 additions and 23 deletions

View File

@@ -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)

View File

@@ -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"
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="max-w-prose mx-auto text-gray-600 dark:text-gray-200 flex"
div class=""
= "Published #{post.display_published_at}"
= "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"
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]
a rel="syndication" class="u-syndication" href=loc[:url]
== render loc[:location]

View File

@@ -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