Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-ssg

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-ssg - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

5

index.js

@@ -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 @@

4

package.json
{
"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();
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc