Use old way, it's better
This commit is contained in:
parent
a793669c57
commit
868d984987
17
site.moon
17
site.moon
@ -77,17 +77,12 @@ list_posts = (args={}) =>
|
|||||||
posts = @site\query_pages { is_a: "post" }
|
posts = @site\query_pages { is_a: "post" }
|
||||||
table.sort posts, (a, b) -> a.source > b.source
|
table.sort posts, (a, b) -> a.source > b.source
|
||||||
|
|
||||||
return for page in *posts[1, args.limit or #posts]
|
return for { meta: meta, source: source } in *posts[1, args.limit or #posts]
|
||||||
page.tpl_scope = page\get_tpl_scope!
|
common.fill_ignoring_pre template,
|
||||||
page.meta.title = page.meta.title or titleize_slug page.meta.id
|
target: meta.target
|
||||||
page.template_stack = common.Stack!
|
title: meta.title or titleize_slug meta.id
|
||||||
page.template_stack\push @site.config.default_template
|
publish_date: publish_date source
|
||||||
@renderer\render page, template
|
blurb: meta.blurb
|
||||||
-- common.fill_ignoring_pre template,
|
|
||||||
-- target: meta.target
|
|
||||||
-- post_title: meta.title or titleize_slug meta.id
|
|
||||||
-- publish_date: publish_date source
|
|
||||||
-- blurb: meta.blurb
|
|
||||||
|
|
||||||
-- call like this from a template: $(get_posts())[[<p>$target</p>]]
|
-- call like this from a template: $(get_posts())[[<p>$target</p>]]
|
||||||
-- or like this: $(get_posts({limit = 5}))[[<p>$target</p>]]
|
-- or like this: $(get_posts({limit = 5}))[[<p>$target</p>]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user