Add syntax highlighting, support draft posts
This commit is contained in:
parent
94c692a54c
commit
6fffd6e1cc
16 changed files with 64 additions and 97 deletions
|
@ -34,6 +34,7 @@ module Pages
|
|||
meta(charset: "utf-8")
|
||||
meta(name: "viewport", content: "width=device-width, initial-scale=1.0")
|
||||
link(rel: "stylesheet", href: "/tailwind.css")
|
||||
link(rel: "stylesheet", href: "/prism/prism.css")
|
||||
|
||||
script(defer: true, 'data-domain' => "farthergate.com", src: "https://plausible.farthergate.com/js/script.js")
|
||||
|
||||
|
@ -65,6 +66,8 @@ module Pages
|
|||
p { "built with phlexite and tailwindcss" }
|
||||
p { "© #{Time.now.year} Aleks Rūtiņš" }
|
||||
}
|
||||
|
||||
script(src: "/prism/prism.js")
|
||||
}
|
||||
}
|
||||
end
|
||||
|
|
|
@ -8,7 +8,14 @@ class Pages::Post < ::Phlex::HTML
|
|||
render ::Pages::Layout.new({title: meta['title']}) {
|
||||
article(class: 'prose prose-lg m-auto') {
|
||||
h1 { meta['title'] }
|
||||
time(datetime: meta['published_on']) { meta['published_on'] }
|
||||
if meta['published_on']
|
||||
time(datetime: meta['published_on']) { meta['published_on'] }
|
||||
else
|
||||
div(class: 'flex flex-row gap-2 -my-5 items-center') {
|
||||
raw safe(::Util::Heroicons.pencil_square('size-4 block'))
|
||||
p { 'Draft' }
|
||||
}
|
||||
end
|
||||
|
||||
hr
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue