implement blog

This commit is contained in:
Aleks Rūtiņš 2024-10-06 22:07:20 -04:00
parent b4dcd84581
commit a52f258402
8 changed files with 77 additions and 2 deletions

View file

@ -1,7 +1,22 @@
class Pages::Blog < ::Phlex::HTML
include Util::PostLoader
def view_template
render ::Pages::Layout.new(:blog) {
p { "under construction" }
ul {
posts.each { |post|
meta = post[:data].front_matter
return unless meta.key?('published_on')
li {
p {
time(datetime: meta['published_on']) { meta['published_on'] }
a(href: '/p/' + post[:slug], style: "padding-left: 10px;") { meta['title'] }
}
}
}
}
}
end
end