grunt-pages
Advanced tools
Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "grunt-pages", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Grunt task to generate a blog.", | ||
@@ -12,3 +12,3 @@ "main": "Gruntfile.js", | ||
"pygmentize-bundled": "~1.0.1", | ||
"marked": "git://github.com/ChrisWren/marked.git#dcbb4e22edfc96a3a9ec38ec4cc8c35682c8290c", | ||
"marked": "git://github.com/ChrisWren/marked.git#14b61ad95e78d6df4ad9cbaca41dee699ad68443", | ||
"js-yaml": "~2.1.0" | ||
@@ -15,0 +15,0 @@ }, |
@@ -148,2 +148,4 @@ # grunt-pages | ||
**0.2.3** - Ignore dotfiles, error reporting for incorrect data JSON files, and new header anchor link format. | ||
**0.2.2** - Used forked version of marked to enable header anchor links. | ||
@@ -150,0 +152,0 @@ |
@@ -25,3 +25,3 @@ 'use strict'; | ||
var numPosts = grunt.file.expand({ filter: 'isFile' }, [this.data.src + '/**', '!**/_**']).length; | ||
var numPosts = grunt.file.expand({ filter: 'isFile' }, [this.data.src + '/**', '!**/_**', '!**/.**']).length; | ||
var parsedPosts = 0; | ||
@@ -31,4 +31,4 @@ var postCollection = []; | ||
grunt.file.recurse(this.data.src, function (abspath) { | ||
// Don't include draft posts | ||
if (path.basename(abspath).indexOf('_') === 0) { | ||
// Don't include draft posts or dotfiles | ||
if (path.basename(abspath).indexOf('_') === 0 || path.basename(abspath).indexOf('.') === 0) { | ||
return; | ||
@@ -61,6 +61,10 @@ } | ||
if (options.data) { | ||
templateData.data = JSON.parse(fs.readFileSync(options.data)); | ||
try { | ||
templateData.data = JSON.parse(fs.readFileSync(options.data)); | ||
} catch (e) { | ||
grunt.fail.fatal(e + ' when parsing ' + options.data); | ||
} | ||
} | ||
postCollection = generatePosts(templateData, abspath); | ||
generatePosts(templateData, abspath); | ||
if (options.pageSrc) { | ||
@@ -177,4 +181,2 @@ generatePages(templateData); | ||
}); | ||
return postCollection; | ||
} | ||
@@ -194,2 +196,7 @@ | ||
// Don't include dotfiles | ||
if (path.basename(abspath).indexOf('.') === 0) { | ||
return; | ||
} | ||
// Don't generate the paginated list page | ||
@@ -196,0 +203,0 @@ if (abspath !== listPage) { |
Sorry, the diff of this file is not supported yet
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable and can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable and can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
10
313
160
23059