Improve author/timestamp

This commit is contained in:
Edward Loveall 2021-09-04 22:05:58 -04:00
parent b3166102c7
commit 04b8d90b8f
No known key found for this signature in database
GPG Key ID: 789A4AE983AC8901
2 changed files with 9 additions and 6 deletions

View File

@ -1 +1,8 @@
@import "~tufte-css/tufte.css";
p.meta {
margin-top: 1rem;
margin-bottom: 1rem;
font-size: 1.2rem;
line-height: 1;
}

View File

@ -10,8 +10,8 @@ class Articles::ShowPage < MainLayout
if subtitle = page.subtitle
para subtitle, class: "subtitle"
end
para do
text "#{page.author} #{created_at(page.created_at)}"
para class: "meta" do
text "#{page.author} on #{page.created_at.to_s("%F")}"
end
article do
section do
@ -19,8 +19,4 @@ class Articles::ShowPage < MainLayout
end
end
end
def created_at(time : Time) : String
"at #{time.to_s("%I:%M%p")} on #{time.to_s("%F")}"
end
end