Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
Fix gulp file system issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
ducksoupdev committed Feb 26, 2015
1 parent a1d9e63 commit 0d91022
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion gulp/lib/dates.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -24,6 +24,7 @@
keys.forEach(function (key) {
allDatesArray.push({
dateMonth: key,
dateStr: moment(key, 'YYYY-MM').format('MMMM YYYY'),
dateLink: allDates[key]
});
});
Expand Down
2 changes: 1 addition & 1 deletion gulp/lib/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
}
Expand Down
1 change: 0 additions & 1 deletion gulp/tests/compile-dates.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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":"<p>Test post content</p>"}', {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":"<p>Test post content</p>"}', {encoding: 'utf8'});
compileDates.run(rootPath, done, errorStub);
Expand Down
1 change: 0 additions & 1 deletion gulp/tests/compile-tags.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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":"<p>Test post content</p>"}', {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":"<p>Test post content</p>"}', {encoding: 'utf8'});
compileTags.run(rootPath, done, errorStub);
Expand Down
4 changes: 2 additions & 2 deletions gulp/tests/dates.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

it('Should get all dates as links', function() {
expect(dates.getAllDatesAsLinks('.', this.posts)).to.deep.equal([
{dateMonth: '2014-06', dateLink: '<a href="./date/2014-06">June 2014</a>'},
{dateMonth: '2014-12', dateLink: '<a href="./date/2014-12">December 2014</a>'}
{dateMonth: '2014-06', dateStr: 'June 2014', dateLink: './date/2014-06'},
{dateMonth: '2014-12', dateStr: 'December 2014', dateLink: './date/2014-12'}
]);
});
});
Expand Down
6 changes: 3 additions & 3 deletions gulp/tests/tags.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@

it('Should get all tags as links', function() {
expect(tags.getAllTagsAsLinks('.', this.posts)).to.deep.equal([
{tag: 'content', tagLink: '<a href="./tag/content">content</a>'},
{tag: 'gulp', tagLink: '<a href="./tag/gulp">gulp</a>'},
{tag: 'testing', tagLink: '<a href="./tag/testing">testing</a>'}
{tag: 'content', tagLink: './tag/content'},
{tag: 'gulp', tagLink: './tag/gulp'},
{tag: 'testing', tagLink: './tag/testing'}
]);
});
});
Expand Down

0 comments on commit 0d91022

Please sign in to comment.