Mercurial > piecrust2
changeset 733:40aaec6d1d85
tests: Add some tests for blog archives and multi-blog features.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 01 Jun 2016 22:11:51 -0700 |
parents | dfd9f5ee4622 |
children | 3f01f63b7247 |
files | tests/bakes/test_archives.yaml tests/bakes/test_multiblog.yaml |
diffstat | 2 files changed, 67 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/bakes/test_archives.yaml Wed Jun 01 22:11:51 2016 -0700 @@ -0,0 +1,43 @@ +--- +in: + pages/_year.html: | + Posts in {{year}} + {% for post in pagination.posts -%} + {{post.url}} + {% endfor %} + posts/2015-12-01_post0.html: '' + posts/2016-01-01_post1.html: '' + posts/2016-01-02_post2.html: '' + posts/2016-01-03_post3.html: '' + posts/2016-01-04_post4.html: '' + posts/2016-01-05_post5.html: '' + posts/2016-01-06_post6.html: '' + posts/2016-01-07_post7.html: '' +outfiles: + archives/2016.html: | + Posts in 2016 + /2016/01/07/post7.html + /2016/01/06/post6.html + /2016/01/05/post5.html + /2016/01/04/post4.html + /2016/01/03/post3.html + archives/2016/2.html: | + Posts in 2016 + /2016/01/02/post2.html + /2016/01/01/post1.html +--- +in: + pages/_year.html: | + Posts in {{year}} + {% for post in archives -%} + {{post.url}} + {% endfor %} + posts/2015-12-01_post0.html: '' + posts/2016-01-01_post1.html: '' + posts/2016-01-02_post2.html: '' +outfiles: + archives/2016.html: | + Posts in 2016 + /2016/01/01/post1.html + /2016/01/02/post2.html +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/bakes/test_multiblog.yaml Wed Jun 01 22:11:51 2016 -0700 @@ -0,0 +1,24 @@ +--- +config: + site: + blogs: [one, two] +in: + posts/one/2016-01-01_post1.html: '' + posts/two/2016-01-02_post2.html: '' + pages/foo-one.html: "Link: {{pcposturl(2016, 01, 01, 'post1', 'one')}}" + pages/foo-two.html: "Link: {{pcposturl(2016, 01, 02, 'post2', 'two')}}" +outfiles: + foo-one.html: "Link: /one/2016/01/01/post1.html" + foo-two.html: "Link: /two/2016/01/02/post2.html" +--- +config: + site: + blogs: [one, two] +in: + posts/one/2016-01-01_post1.html: '' + posts/two/2016-01-02_post2.html: '' + pages/foo-one.html: "---\nblog: one\n---\nLink: {{pcposturl(2016, 01, 01, 'post1')}}" + pages/foo-two.html: "---\nblog: two\n---\nLink: {{pcposturl(2016, 01, 02, 'post2')}}" +outfiles: + foo-one.html: "Link: /one/2016/01/01/post1.html" + foo-two.html: "Link: /two/2016/01/02/post2.html"