liquid-to-handlebars

Convert liquid templates to handlebars templates. Quick way to convert - for example - HTML components from Bootstrap's docs into handlebars UI components in a way that makes them actually reusable in node.js projects.

liquid-to-handlebars

Convert liquid templates to handlebars templates. Quick way to convert - for example - HTML components from Bootstrap's docs into handlebars UI components in a way that makes them actually reusable in node.js projects.

Install with npm

$ npm i liquid-to-handlebars --save-dev
var convert = require('liquid-to-handlebars');
 
// pass a string of HTML with liquid 
console.log(convert('{liquid}'));

So replacement patterns for number of tags and filters have not been implemented. Here is the replacement pattern for converting {{content}} liquid variables to {% body %} layout tags, compatible with [assemble][], [verb][] and any other [template][]-base application.

{
  pattern: tag.makeVariable('content', {matter: ''}),
  replacementfunction (matchstr) {
    return '{% body %}';
  }
}

To test drive the example:

git clone https://github.com/jonschlinkert/liquid-to-handlebars.git

Then cd into the project and run npm install.

Next, clone Bootstrap

Don't use Bower, use git clone since we need to actual HTML docs:

git clone https://github.com/twbs/bootstrap.git "vendor/bootstrap"

Next, run

node examples/example

Converted files will be written to the ./results directory.

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Jon Schlinkert

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on July 15, 2015.