gulp-inject-partials
Advanced tools
Comparing version 0.0.3 to 1.0.0
{ | ||
"name": "gulp-inject-partials", | ||
"version": "0.0.3", | ||
"version": "1.0.0", | ||
"description": "A recursive injection of partials based on their path name for gulp", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -5,3 +5,2 @@ # gulp-inject-partials | ||
[![Build Status](https://travis-ci.org/meeroslav/gulp-inject-partials.svg?branch=master)](https://travis-ci.org/meeroslav/gulp-inject-partials) | ||
[![Dependency Status](https://david-dm.org/meeroslav/gulp-inject-partials.svg)](https://david-dm.org/meeroslav/gulp-inject-partials) | ||
[![Code Climate](https://codeclimate.com/github/meeroslav/gulp-inject-partials/badges/gpa.svg)](https://codeclimate.com/github/meeroslav/gulp-inject-partials) | ||
@@ -101,3 +100,3 @@ | ||
<!-- partial:_mypartial3.html --> | ||
<!-- partial --> | ||
<!-- partial --> | ||
</div> | ||
@@ -117,3 +116,3 @@ ``` | ||
``` | ||
**gulpfile.js** | ||
**gulpfile.js** | ||
```javascript | ||
@@ -149,3 +148,3 @@ var gulp = require('gulp'); | ||
</div> | ||
<!-- partial --> | ||
<!-- partial --> | ||
</div> | ||
@@ -269,3 +268,3 @@ <!-- partial --> | ||
Param (optional): | ||
- `path` - relative path to source file | ||
- `path` - relative path to source file | ||
@@ -272,0 +271,0 @@ Default: `<!-- partial:{{path}} -->` |
@@ -33,7 +33,7 @@ 'use strict'; | ||
} | ||
if (target.isStream()) { | ||
return cb(error(target.path + ': Streams not supported for target templates!')); | ||
} | ||
try { | ||
@@ -75,6 +75,6 @@ var tagsRegExp = getRegExpTags(opt); | ||
listOfFiles.pop(); | ||
targetContent = inject(targetContent, String(content), opt, fileData.tags); | ||
}); | ||
if (listOfFiles.length === 1 && !opt.quiet) { | ||
if (listOfFiles.length === 1 && !opt.quiet && files.length) { | ||
log(cyan(files.length) + ' partials injected into ' + magenta(targetPath) + '.'); | ||
@@ -109,5 +109,5 @@ } | ||
var toInject = [sourceContent]; | ||
// content part before start tag | ||
// content part before start tag | ||
var newContents = targetContent.slice(0, startMatch.index); | ||
if (opt.removeTags) { | ||
@@ -137,4 +137,4 @@ // Take care of content length change | ||
* Prepare regular expressions for parsing template | ||
* Replace {{path}} with regular expression for matching relative path | ||
* or with exact file path | ||
* Replace {{path}} with regular expression for matching relative path | ||
* or with exact file path | ||
* | ||
@@ -141,0 +141,0 @@ * @param {Object} opt |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
22531
297