diff --git a/site.moon b/site.moon index b135c37..e30f396 100644 --- a/site.moon +++ b/site.moon @@ -63,7 +63,7 @@ titleize_slug = (slug="") -> template = [[
-

$post_title

+

$title

— $blurb Read post →
@@ -77,12 +77,17 @@ list_posts = (args={}) => posts = @site\query_pages { is_a: "post" } table.sort posts, (a, b) -> a.source > b.source - return for { meta: meta, source: source } in *posts[1, args.limit or #posts] - 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 + return for page in *posts[1, args.limit or #posts] + page.tpl_scope = page\get_tpl_scope! + page.meta.title = page.meta.title or titleize_slug page.meta.id + page.template_stack = common.Stack! + page.template_stack\push @site.config.default_template + @renderer\render page, template + -- 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())[[

$target

]] -- or like this: $(get_posts({limit = 5}))[[

$target

]]