Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set allowInlineIncludes for Twig adapter? #5

Open
MXTcomunica opened this issue Mar 27, 2018 · 0 comments
Open

How to set allowInlineIncludes for Twig adapter? #5

MXTcomunica opened this issue Mar 27, 2018 · 0 comments

Comments

@MXTcomunica
Copy link

HI!

I'm trying to use Twig as adapter, but inline inclusions within templates like:

<div>
  <h1>Hello</h1>

  {% include '../../01-atoms/button/button.twig' %}

</div>

Throws the following error:

Error parsing twig template undefined: 
TwigException: Cannot extend an inline template.

Googleling around I see that setting allowInlineIncludes: true should resolve:

twigjs/twig.js#262

But I don't know how to set this here in frctl/consolidate settings:

const twig = require('twig');
const consolidate = require('@frctl/consolidate');

**** WHAT INSTRUCTION HERE TO SET allowInlineIncludes: true ? ****

const twigAdapter = consolidate('twig', twig);
fractal.components.engine(twigAdapter);  // use the consolidate/twig adapter
fractal.components.set('ext', '.twig'); // look for files with a .twig file extension

Please help me, thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant