Inline posts list template
This commit is contained in:
parent
0dc346f591
commit
ee8d797a15
16
site.moon
16
site.moon
@ -79,19 +79,17 @@ titleize_slug = (slug) ->
|
||||
words = [{ titleize word } for word in *common.split slug, "-"]
|
||||
table.concat [head .. tail for { head, tail } in *words], " "
|
||||
|
||||
template = [[
|
||||
<section>
|
||||
<h3><a href="$target">$post_title</a></h3>
|
||||
<time>$publish_date</time> — $blurb
|
||||
<a class="read-post-link" href="$target">Read post →</a>
|
||||
</section>
|
||||
]]
|
||||
|
||||
list_posts = (page, args={}) ->
|
||||
posts = page.site\query_pages { is_a: "post" }
|
||||
table.sort posts, (a, b) -> a.source > b.source
|
||||
|
||||
table.concat [common.fill_ignoring_pre template, {
|
||||
table.concat [common.fill_ignoring_pre [[
|
||||
<section>
|
||||
<h3><a href="$target">$post_title</a></h3>
|
||||
<time>$publish_date</time> — $blurb
|
||||
<a class="read-post-link" href="$target">Read post →</a>
|
||||
</section>
|
||||
]], {
|
||||
target: meta.target
|
||||
post_title: meta.title or titleize_slug meta.id
|
||||
publish_date: publish_date source
|
||||
|
Loading…
x
Reference in New Issue
Block a user