diff --git a/gulp/lib/dates.js b/gulp/lib/dates.js index f0b4f82..3b020df 100644 --- a/gulp/lib/dates.js +++ b/gulp/lib/dates.js @@ -15,7 +15,7 @@ posts.forEach(function (post) { var dateMonth = post.date.substr(0, 7); //2014-12 if (!allDates[dateMonth]) { - allDates[dateMonth] = self.getDateAsLink(path, dateMonth, moment(dateMonth, 'YYYY-MM').format('MMMM YYYY')); + allDates[dateMonth] = path + '/date/' + dateMonth; } }); var keys = Object.keys(allDates); @@ -24,6 +24,7 @@ keys.forEach(function (key) { allDatesArray.push({ dateMonth: key, + dateStr: moment(key, 'YYYY-MM').format('MMMM YYYY'), dateLink: allDates[key] }); }); diff --git a/gulp/lib/tags.js b/gulp/lib/tags.js index db665f0..47310e8 100644 --- a/gulp/lib/tags.js +++ b/gulp/lib/tags.js @@ -37,7 +37,7 @@ var tagList = post.tagStr.split(' '); tagList.forEach(function (tag) { if (!allTags[tag]) { - allTags[tag] = self.getTagAsLink(path, tag); + allTags[tag] = path + '/tag/' + tag; } }); } diff --git a/gulp/tests/compile-dates.spec.js b/gulp/tests/compile-dates.spec.js index bcafe0f..ffb7990 100644 --- a/gulp/tests/compile-dates.spec.js +++ b/gulp/tests/compile-dates.spec.js @@ -118,7 +118,6 @@ describe('When compiling date pages and excluding draft templates', function () { before(function (done) { - removeDir(rootPath + '/build/date'); fs.writeFileSync(rootPath + '/build/content/posts/test-post1.json', '{"slug":"test-post1","title":"Test post 1","date":"2014-06-11","tags":"mocha","template":"post.hbs","body":"
Test post content
"}', {encoding: 'utf8'}); fs.writeFileSync(rootPath + '/build/content/posts/test-post2.json', '{"slug":"test-post2","title":"Test post 2","date":"2014-12-05","status":"draft","tags":"mocha coke","template":"post.hbs","body":"Test post content
"}', {encoding: 'utf8'}); compileDates.run(rootPath, done, errorStub); diff --git a/gulp/tests/compile-tags.spec.js b/gulp/tests/compile-tags.spec.js index 4047b1f..609501d 100644 --- a/gulp/tests/compile-tags.spec.js +++ b/gulp/tests/compile-tags.spec.js @@ -118,7 +118,6 @@ describe('When compiling tag pages and excluding draft templates', function () { before(function (done) { - removeDir(rootPath + '/build/tag'); fs.writeFileSync(rootPath + '/build/content/posts/test-post1.json', '{"slug":"test-post1","title":"Test post 1","date":"2014-06-11","tags":"mocha","template":"post.hbs","body":"Test post content
"}', {encoding: 'utf8'}); fs.writeFileSync(rootPath + '/build/content/posts/test-post2.json', '{"slug":"test-post2","title":"Test post 2","date":"2014-12-05","status":"draft","tags":"mocha coke","template":"post.hbs","body":"Test post content
"}', {encoding: 'utf8'}); compileTags.run(rootPath, done, errorStub); diff --git a/gulp/tests/dates.spec.js b/gulp/tests/dates.spec.js index 798c5aa..270cf88 100644 --- a/gulp/tests/dates.spec.js +++ b/gulp/tests/dates.spec.js @@ -24,8 +24,8 @@ it('Should get all dates as links', function() { expect(dates.getAllDatesAsLinks('.', this.posts)).to.deep.equal([ - {dateMonth: '2014-06', dateLink: 'June 2014'}, - {dateMonth: '2014-12', dateLink: 'December 2014'} + {dateMonth: '2014-06', dateStr: 'June 2014', dateLink: './date/2014-06'}, + {dateMonth: '2014-12', dateStr: 'December 2014', dateLink: './date/2014-12'} ]); }); }); diff --git a/gulp/tests/tags.spec.js b/gulp/tests/tags.spec.js index e26272c..b39b421 100644 --- a/gulp/tests/tags.spec.js +++ b/gulp/tests/tags.spec.js @@ -41,9 +41,9 @@ it('Should get all tags as links', function() { expect(tags.getAllTagsAsLinks('.', this.posts)).to.deep.equal([ - {tag: 'content', tagLink: 'content'}, - {tag: 'gulp', tagLink: 'gulp'}, - {tag: 'testing', tagLink: 'testing'} + {tag: 'content', tagLink: './tag/content'}, + {tag: 'gulp', tagLink: './tag/gulp'}, + {tag: 'testing', tagLink: './tag/testing'} ]); }); });