implement blog
This commit is contained in:
parent
b4dcd84581
commit
a52f258402
8 changed files with 77 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue