gje

gulp-jade-exports

extract exports from a group of jade files

Showing:

Popularity

Downloads/wk

42

GitHub Stars

2

Maintenance

Last Commit

7yrs ago

Contributors

0

Package

Dependencies

2

Size (min+gzip)

65.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

gulp-jade-exports

https://travis-ci.org/bloodyowl/gulp-jade-exports

takes all the exports blocks from the given jade files to collect information before running the jade task.

this can be used to collect all the metadata to use it in the templates afterwards.

install

$ npm install gulp-jade-exports

notice

your project must have LF line-endings. you can easily configure that using .gitattributes.

usage

in your jade page

block exports
  -exports.title = "my page title"
  -exports.tags = ["wow", "very", "seo"]

in your gulp file

var gulp = require("gulp")
  , jade = require("gulp-jade")
  , pages = require("gulp-jade-exports")

gulp.task("exports", function(){
  return gulp.src("pages/**.jade")
    .pipe(pages())
})

gulp.task("pages", ["exports"], function(){
  return gulp.src("pages/**.jade")
    .pipe(jade({
      locals : {
        pages : pages.exports
      }
    }))
})

now all the jade files found in pages will receive a local pages object like this :

{
  "index" : {
    "title" : "my page title",
    "tags" : ["wow", "very", "seo"]
  },
  "about" : {
    "title" : "my page title",
    "tags" : ["some", "other", "tags"]
  }
}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100