Add time machine
This commit is contained in:
@@ -8,6 +8,7 @@ div class="mb-12 max-w-prose mx-auto text-gray-800 dark:text-gray-200"
|
||||
/ a class="block p-1 border border-blue-200 bg-blue-300 text-blue-900 hover:bg-blue-200 text-center rounded-lg" href="/years" 🗓️ By year
|
||||
a class="block p-1 border border-blue-200 bg-blue-200 text-blue-900 hover:bg-blue-300 text-center rounded-lg" href="/posts" 🪧 All posts
|
||||
a class="block p-1 border border-blue-200 bg-blue-200 text-blue-900 hover:bg-blue-300 text-center rounded-lg" href="/tagged/weekly" 🔄 Week posts
|
||||
a class="block p-1 border border-blue-200 bg-blue-200 text-blue-900 hover:bg-blue-300 text-center rounded-lg" href="/timemachine/#{Time.now.strftime("%Y/%m/%d")}" ⏳ Time machine
|
||||
|
||||
h2 class="text-xl" Explore everything else
|
||||
|
||||
|
@@ -4,7 +4,7 @@ div class="mb-8 h-entry"
|
||||
= post.display_title
|
||||
div class="e-content prose-p:mb-0 prose-img:my-2 prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline p-name text-base prose prose-ul:list-none prose-ul:pl-0 prose-li:pl-0 text-gray-800 dark:text-gray-200 prose-a:dark:text-gray-100"
|
||||
== post.excerpt
|
||||
div class="grid gap-4 grid-flow-row grid-cols-4 grid-rows-1"
|
||||
div class="grid gap-4 grid-flow-row grid-cols-#{post.photos.count} grid-rows-1"
|
||||
-post.photos.each do |photo|
|
||||
img class="w-44 h-44 object-cover rounded" src=photo["value"]
|
||||
/ == render "shared/tags", tags: post.tags
|
||||
|
56
app/templates/timemachine/show.html.slim
Normal file
56
app/templates/timemachine/show.html.slim
Normal file
@@ -0,0 +1,56 @@
|
||||
div class="prose dark:prose-invert w-full max-w-6xl mx-auto px-4 m-4"
|
||||
div class="grid md:grid-cols-12 gap-5 p-4 m-2"
|
||||
div class="md:col-span-8 p-4"
|
||||
h2 class="mt-0" = display_date
|
||||
|
||||
a href="/timemachine/#{prev_date}" ← #{prev_date}
|
||||
|
||||
a class="inline-block px-2" href="/timemachine/#{today}" Today
|
||||
|
||||
- if next_date
|
||||
a href="/timemachine/#{next_date}" #{next_date} →
|
||||
|
||||
- if posts.count > 0
|
||||
div class="mt-4"
|
||||
- posts.each_with_index do |post, index|
|
||||
div class="#{"border-t-2" if index == 0} border-b-2 border-gray-200"
|
||||
- if post.photos.count == 0
|
||||
a href="/post/#{post.slug}"
|
||||
h3= post.name
|
||||
== post.excerpt
|
||||
- else
|
||||
div class="grid grid-cols-3 gap-2"
|
||||
- posts.each do |post|
|
||||
- if post.photos.count > 0
|
||||
- post.photos.each do |photo|
|
||||
a href="/post/#{post.slug}"
|
||||
img class="mb-0 rounded" src="#{photo["value"]}"
|
||||
a href="/post/#{post.slug}"
|
||||
= post.name
|
||||
- else
|
||||
p No posts
|
||||
|
||||
aside class="md:col-span-4 md:pt-0 p-2"
|
||||
- if bookmarks.count > 0
|
||||
h3 class="mt-0" Bookmarks
|
||||
|
||||
div
|
||||
ul
|
||||
- bookmarks.each do |bookmark|
|
||||
li
|
||||
a href="/bookmark/#{bookmark.slug}"
|
||||
= bookmark.name
|
||||
|
||||
- if podcasts.count > 0
|
||||
h3 class="mt-0" Podcasts
|
||||
|
||||
div
|
||||
ul
|
||||
- podcasts.each do |podcast|
|
||||
li
|
||||
a href=podcast.url
|
||||
=podcast.title
|
||||
div
|
||||
small = podcast.podcast_name
|
||||
/ h3 class="mt-0" Music
|
||||
/ h3 class="mt-0" Reading
|
Reference in New Issue
Block a user