Mercurial > piecrust2
diff tests/bakes/test_linker.yaml @ 404:27b10024f8d8
linker: Add ability to return the parent and ancestors of a page.
Add reference documentation.
Add tests.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 24 May 2015 18:15:22 -0700 |
parents | 8e1e55ad35fb |
children | 45ad976712ec |
line wrap: on
line diff
--- a/tests/bakes/test_linker.yaml Thu May 21 07:33:08 2015 -0700 +++ b/tests/bakes/test_linker.yaml Sun May 24 18:15:22 2015 -0700 @@ -46,3 +46,34 @@ Bar Foo SELFIE! Other +--- +in: + pages/foo.md: "---\ntitle: Foo\n---\n" + pages/foo/one.md: | + {{family.parent.url}} {{family.parent.title}} +outfiles: + foo/one.html: /foo.html Foo +--- +in: + pages/foo.md: "---\ntitle: Foo\n---\n" + pages/foo/bar.md: "---\ntitle: Bar\n---\n" + pages/foo/bar/one.md: | + {{family.parent.url}} {{family.parent.title}} + {{family.parent.parent.url}} {{family.parent.parent.title}} +outfiles: + foo/bar/one.html: | + /foo/bar.html Bar + /foo.html Foo +--- +in: + pages/foo.md: "---\ntitle: Foo\n---\n" + pages/foo/bar.md: "---\ntitle: Bar\n---\n" + pages/foo/bar/one.md: | + {% for p in family.ancestors -%} + {{p.url}} {{p.title}} + {% endfor %} +outfiles: + foo/bar/one.html: | + /foo/bar.html Bar + /foo.html Foo +