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

gulp-liquify

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-liquify

Render Liquid templates in Gulp using TinyLiquid

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
127
increased by9.48%
Maintainers
1
Weekly downloads
 
Created
Source

Gulp Liquify

A Liquid template render using TinyLiquid

####Installation

$ npm install gulp-liquify

####Usage

var liquify = require('gulp-liquify');

gulp.task("liquify", function() {
  var locals = {
    name: "Fred"
  };
  gulp.src('*.liquid')
    .pipe(liquify(locals))
    .pipe(gulp.dest('./dist/'))
});

You can pass a base for other templates to be included in a template. It defaults to the file base.

  gulp.src('*.liquid')
    .pipe(liquify(locals, { base: "../templates/" }))
});

You can pass file specific locals by attaching it to the vinyl file object in a previous task.

var liquify = require('gulp-liquify');
var through = require('through2');

gulp.task("liquify", function() {
  var locals = {
    name: "Fred"
  };
  gulp.src('*.liquid')
    .pipe(through.obj(function(file, enc, cb) {
      file.locals = {
        number: Math.random(),
        path: file.path
      };
      cb(null, file);
    }))
    .pipe(liquify(locals))
    .pipe(gulp.dest('./dist/'))
});

####Liquid support from tinyliquid

TinyLiquid does not support the locals variables like this: a[0], a["b"], a[0]["b"] and so on.

Only support to use . as the separator: a.b, a.b.c

Keywords

FAQs

Package last updated on 10 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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