Mercurial > piecrust2
view tests/bakes/test_data_provider.yaml @ 912:cd236a6af9f6
data: Add access to route metadata in the templating data.
It's available under `route`.
Also, rename `slug` to `rel_url`, because it's confusing when `slug` could
be the route metadata of the same name as provided by the default page source.
The old `slug` is still there for backwards compatibility though.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 28 Apr 2017 10:05:14 -0700 |
parents | 42efc3634763 |
children | 45ad976712ec |
line wrap: on
line source
--- in: pages/foo.md: | Foo! pages/bar.md: | Bar! pages/allpages.md: | {% for p in site.pages -%} {{p.url}} {% endfor %} outfiles: allpages.html: | /allpages.html /bar.html /foo.html / --- in: posts/2016-06-01_one.md: "One!" posts/2016-06-02_two.md: "Two!" posts/2016-06-03_three.md: "Three!" pages/_index.md: | {% for p in blog.posts -%} {{p.url}} {% endfor %} outfiles: index.html: | /2016/06/03/three.html /2016/06/02/two.html /2016/06/01/one.html --- config: blog: subtitle: "Forcing a Merged Mapping" in: posts/2016-06-01_one.md: "One!" posts/2016-06-02_two.md: "Two!" posts/2016-06-03_three.md: "Three!" pages/_index.md: | {{blog.subtitle}} {% for p in blog.posts -%} {{p.url}} {% endfor %} outfiles: index.html: | Forcing a Merged Mapping /2016/06/03/three.html /2016/06/02/two.html /2016/06/01/one.html --- config: site: blogs: [aaa, xyz] in: posts/aaa/2016-06-01_one.md: "One!" posts/aaa/2016-06-02_two.md: "Two!" posts/xyz/2016-06-01_one-other.md: "One Other!" posts/xyz/2016-06-02_two-other.md: "Two Other!" pages/_index.md: | {% for p in aaa.posts -%} {{p.url}} {% endfor %} {% for p in xyz.posts -%} {{p.url}} {% endfor %} outfiles: index.html: | /aaa/2016/06/02/two.html /aaa/2016/06/01/one.html /xyz/2016/06/02/two-other.html /xyz/2016/06/01/one-other.html