From 6fd0c4b95eb82e5c60b3740dabcfe4590fe78d82 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 1 Jul 2017 13:33:48 +0200 Subject: fix(Responders): fix incorrect post URLs --- src/responders.js | 2 +- test/app.test.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/responders.js b/src/responders.js index e285018..70f7f90 100644 --- a/src/responders.js +++ b/src/responders.js @@ -38,7 +38,7 @@ function title(siteTitle, pageTitle) { const renderPostListItem = ctx => post => ({ a: { - href: ctx.getURL(post, post.basename), + href: ctx.getURL("post", post.basename), _text: post.data.get("title") } }); diff --git a/test/app.test.js b/test/app.test.js index 92a7a76..d298a03 100644 --- a/test/app.test.js +++ b/test/app.test.js @@ -33,6 +33,7 @@ test("homepage", t => { t.is($("h1").text(), "John Doe"); t.is($("main").length, 1); t.is($("main .posts").length, 1); + t.is($(".post:first-of-type a").attr("href"), "/post/testfile"); return $; }) .then(toMicroformatsOptions) @@ -94,6 +95,7 @@ test("tags", t => { .then($ => { t.is($("head > title").text(), "A ยท John Doe"); t.is($(".post a").text(), "This is a test"); + t.is($(".post:first-of-type a").attr("href"), "/post/testfile"); }); }); -- cgit 1.4.1