Skip to content

boltdesignsystem/basalt-twig-renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note: this is a copy of @basalt/[email protected] (NPM distributed version) with upgraded @babel dependencies, required to fix errors with @babel < v7.8.7, see babel/babel#11216.

Not to be confused with boltdesignsystem/twig-renderer which is a forked version of the same library's source files.

Twig Renderer

Greenkeeper badge

Render templates using Twig PHP, via this Node JS renderer.

Special thanks to Salem Ghoweri for collaboration on this project!

How to Use

npm install --save @basalt/twig-renderer
const TwigRenderer = require('@basalt/twig-renderer');

const config = { 
  // see `./config.schema.js` for details
};

const twigRenderer = new TwigRenderer(config);

twigRenderer.render('@components/card.twig', { title: 'hi' }).then(results => {
  if (results.ok) {
    console.log(results.html);
  } else {
    console.log(results.message);
  }
});

Looking in tests folder can help.

How to Develop

npm install
composer install
npm run setup

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published