Comparing version 2.0.0 to 2.1.0
@@ -24,3 +24,4 @@ 'use strict'; | ||
baseUrl: '', | ||
sort: 'url' | ||
sort: 'url', | ||
cleanUrls: true | ||
}, options || {}); | ||
@@ -133,3 +134,3 @@ | ||
function url(file) { | ||
return options.baseUrl + file.relative.replace(/index\..+$/, ''); | ||
return options.baseUrl + (options.cleanUrls ? file.relative.replace(/index\..+$/, '') : file.relative); | ||
} | ||
@@ -136,0 +137,0 @@ |
{ | ||
"name": "gulp-ssg", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"main": "index.js", | ||
@@ -20,3 +20,3 @@ "homepage": "https://github.com/paulwib/gulp-ssg", | ||
"dependencies": { | ||
"lodash": "~3.5.0", | ||
"lodash": "~3.6.0", | ||
"gulp-util": "~3.0.1", | ||
@@ -23,0 +23,0 @@ "through": "~2.3.4" |
@@ -24,3 +24,3 @@ [gulp][]-ssg [![NPM version][npm-image]][npm-url] [![Dependency Status][depstat-image]][depstat-url] [![Build Status][travis-image]][travis-url] | ||
This will add properties to each files `data` property: | ||
This will add properties to each file's `data` property: | ||
@@ -88,3 +88,3 @@ * `file.data.url` - A URL, which is the `file.relative` with a slash prepended and any trailing `index.html` removed | ||
There are [complete examples with templates](https://github.com/paulwib/gulp-ssg/tree/master/example) in the git repo. | ||
There are [complete examples with templates](https://github.com/paulwib/gulp-ssg/tree/master/examples) in the git repo. | ||
@@ -101,3 +101,7 @@ ## Options | ||
### cleanUrls `bool` | ||
Whether or not to remove `index.*` from URLs, defaults to true. Switch to false to have full path including any `index.*`. | ||
[gulp]:http://gulpjs.com | ||
@@ -104,0 +108,0 @@ [gulp-data]:https://github.com/colynb/gulp-data |
@@ -360,4 +360,29 @@ 'use strict'; | ||
it('should support NOT removing index.html from urls', function(done) { | ||
var options = { | ||
cleanUrls: false | ||
}; | ||
var stream = ssg(options); | ||
var h = mockFile('test/index.md'); | ||
var p1 = mockFile('test/hello.xhtml'); | ||
var p2 = mockFile('test/foo/index.htm'); | ||
var p2_1 = mockFile('test/foo/bar.xml'); | ||
stream.on('end', function() { | ||
expect(h.data.url).to.equal('/index.md'); | ||
expect(p1.data.url).to.equal('/hello.xhtml'); | ||
expect(p2.data.url).to.equal('/foo/index.htm'); | ||
expect(p2_1.data.url).to.equal('/foo/bar.xml'); | ||
done(); | ||
}); | ||
stream.write(h); | ||
stream.write(p1); | ||
stream.write(p2); | ||
stream.write(p2_1); | ||
stream.end(); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
23761
472
115
0
+ Addedlodash@3.6.0(transitive)
- Removedlodash@3.5.0(transitive)
Updatedlodash@~3.6.0