Thanks to visit codestin.com
Credit goes to github.com

Skip to content

wilon/gulp-concat-blogdata

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forked from contra/gulp-concat support my blog project. https://github.com/wilon/wilon.github.io

Installation

Install package with NPM and add it to your development dependencies:

npm install git://github.com/wilon/gulp-concat-blogdata.git

Information

Packagegulp-concat-blogdata
Description Concatenates files
Node Version >= 0.10

Usage

var concatBlogMd = require('gulp-concat-blogdata');

gulp.task('scripts', function() {
  return gulp.src('./lib/*.md')
    .pipe(concatBlogMd('all.json'))
    .pipe(gulp.dest('./dist/'));
});

This will concat files by your operating systems newLine. It will take the base directory from the first file that passes through it.

Files will be concatenated in the order that they are specified in the gulp.src function. For example, to concat ./lib/file3.md, ./lib/file1.md and ./lib/file2.md in that order, the following code will create a task to do that:

var concatBlogMd = require('gulp-concat-blogdata');

gulp.task('scripts', function() {
  return gulp.src(['./lib/file3.md', './lib/file1.md', './lib/file2.md'])
    .pipe(concatBlogMd('all.json'))
    .pipe(gulp.dest('./dist/'));
});

file example

md file1:

### the title1
```language
   the content1
   ...

...

result json file: [ { "tag": "file1", "name": "title1", "des": " the content1 ..." }, ... ]

About

Trans md file to json. In order to support my blog project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%