Revert overwritting page.target
This commit is contained in:
parent
e8f62680da
commit
405e19aa72
@ -79,16 +79,13 @@ list_posts = (args={}) =>
|
||||
limit = math.min args.limit or #pages, #pages
|
||||
|
||||
return for page in *pages[1, limit]
|
||||
-- overwrite with our extension-less targets so that urls generated with
|
||||
-- page\url_for! omit the file extension
|
||||
page.target = page.meta.target
|
||||
{ title: title, id: id, publish_date: date, blurb: blurb } = page.meta
|
||||
|
||||
common.fill_ignoring_pre template,
|
||||
title: title or titleize_slug id
|
||||
publish_date: date
|
||||
blurb: blurb
|
||||
url: page\url_for!
|
||||
url: rootname page\url_for!
|
||||
|
||||
-- call like this from a template: $(get_posts())[[<p>$title</p>]]
|
||||
-- or like this: $(get_posts({limit = 5}))[[<p>$title</p>]]
|
||||
@ -105,7 +102,7 @@ get_posts = (args={}) =>
|
||||
title: title or titleize_slug id
|
||||
publish_date: date
|
||||
blurb: blurb
|
||||
url: page\url_for!
|
||||
url: rootname page\url_for!
|
||||
}
|
||||
|
||||
-- replace '$if' helper function with cosmo's 'cif'
|
||||
|
Loading…
x
Reference in New Issue
Block a user