scribe/src/pages/articles/show_page.cr
Edward Loveall fba87c1076
Improve title parsing
The subtitle has been removed because it's difficult to find and error
prone to guess at. It is somewhat accessible from the post's
previewContent field in GraphQL but that can be truncated.
2021-10-03 18:14:46 -04:00

24 lines
491 B
Crystal

class Articles::ShowPage < MainLayout
needs page : Page
def page_title
page.title
end
def content
h1 page.title
para class: "meta" do
text "#{author_link(page.author)} on #{page.created_at.to_s("%F")}"
end
article do
section do
mount PageContent, page: page
end
end
end
def author_link(creator : PostResponse::Creator)
href = Nodes::UserAnchor::USER_BASE_URL + creator.id
a(href: href) { text creator.name }
end
end