vigetlabs / blendid

A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder
MIT License
4.97k stars 685 forks source link

Twig support #586

Closed olets closed 4 years ago

olets commented 4 years ago

Here at Viget we use Twig much more than we use Nunjucks. This PR adds the option to use Twig.js (logo by yours truly;) to process template files. html task defaults to nunjucks for backwards compatibility.

Basic use: in task-config.js, set html.templateLanguage to `twig.

e.g.

  html : {
    templateLanguage: 'twig',
  },

Advanced use: pass gulp-twig options in task-config.js's html.twig

html: {
  templateLanguage: 'twig',
  twig: {…},
},

First commit is to streamline development of Blendid. Third commit is a little tidying up I noticed

Can take it for a spin with

yarn add https://github.com/vigetlabs/blendid.git#twig