diff --git a/app/decorators/posts/decorator.rb b/app/decorators/posts/decorator.rb index e2e2cb4..4684200 100644 --- a/app/decorators/posts/decorator.rb +++ b/app/decorators/posts/decorator.rb @@ -26,12 +26,12 @@ module Adamantium end def prefix_emoji - prefix = name ? "" : "πŸ“―" + prefix = name ? "" : "πŸ’¬" location ? "πŸ—ΊοΈ" : prefix end def display_title - title = name || published_at.strftime("%D") + title = name "#{prefix_emoji} #{title}" end diff --git a/app/repos/post_repo.rb b/app/repos/post_repo.rb index 01a8174..205570b 100644 --- a/app/repos/post_repo.rb +++ b/app/repos/post_repo.rb @@ -93,6 +93,15 @@ module Adamantium query ? base.where(Sequel.ilike(:name, "%#{query}%")).to_a : base.to_a end + def last_location + posts + .where(post_type: "checkin") + .published + .order(Sequel.desc(:published_at)) + .limit(1) + .one + end + def for_rss posts .where(post_type: "post", location: nil) diff --git a/app/templates/shared/_post.html.slim b/app/templates/shared/_post.html.slim index 42cf29f..a05c5ec 100644 --- a/app/templates/shared/_post.html.slim +++ b/app/templates/shared/_post.html.slim @@ -7,5 +7,6 @@ div class="mb-8 h-entry" == render :tags, tags: post.tags p class="text-sm text-blue-400" - time class="dt-published" datetime=post.machine_published_at - = post.display_published_at + a href="#{post.permalink}" + time class="dt-published" datetime=post.machine_published_at + = post.display_published_at diff --git a/app/templates/site/home.html.slim b/app/templates/site/home.html.slim index f137b32..7bca806 100644 --- a/app/templates/site/home.html.slim +++ b/app/templates/site/home.html.slim @@ -5,15 +5,24 @@ div class="h-card prose dark:prose-invert mb-12 max-w-prose mx-auto text-gray-80 div class="mb-8 max-w-screen-md mx-auto border-t-4 border-solid border-gray-400 dark:border-gray-600" div class="mb-4 flex max-w-prose mx-auto" - h2 class="text-xl text-gray-600 dark:text-gray-200" Recent + h2 class="text-l text-gray-600 dark:text-gray-200" Recent posts a class="text-right flex-1 text-blue-400" href="/posts" See all → div class="mb-12 max-w-prose mx-auto" - posts.each do |post| == render :post, post: post +div class="flex max-w-prose mx-auto" + h2 class="text-l text-gray-600 dark:text-gray-200" Photos + a class="text-right flex-1 text-blue-400" href="/photos" See all → + div class="grid grid-cols-3 gap-4 mb-4 max-w-prose mx-auto" - photo_posts.each do |post| == render :photo_post, post: post +div class="mb-12 max-w-prose mx-auto" + p + = "🌏 Last seen at " + a class="text-blue-400" href=last_location.permalink + = last_location.display_title div class="max-w-screen-md mx-auto border-t-4 border-solid border-gray-400 dark:border-gray-600" diff --git a/app/views/site/home.rb b/app/views/site/home.rb index 7df429b..96741b9 100644 --- a/app/views/site/home.rb +++ b/app/views/site/home.rb @@ -21,6 +21,10 @@ module Adamantium Decorators::Posts::Decorator.new(post) end end + + expose :last_location do + Decorators::Posts::Decorator.new(post_repo.last_location) + end end end end diff --git a/public/assets/index.css b/public/assets/index.css index 726e32a..4c6a8bd 100644 --- a/public/assets/index.css +++ b/public/assets/index.css @@ -1475,6 +1475,11 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: rgb(251 146 60 / var(--tw-text-opacity)); } +.hover\:text-blue-600:hover { + --tw-text-opacity: 1; + color: rgb(37 99 235 / var(--tw-text-opacity)); +} + .hover\:underline:hover { text-decoration-line: underline; } @@ -1671,6 +1676,11 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { background-color: rgb(250 204 21 / 0.8); } + .dark\:hover\:text-blue-200:hover { + --tw-text-opacity: 1; + color: rgb(191 219 254 / var(--tw-text-opacity)); + } + .dark\:hover\:text-yellow-100:hover { --tw-text-opacity: 1; color: rgb(254 249 195 / var(--tw-text-opacity));