NightlyCommit / twing-loader

*** This project is now hosted in GitLab ***
https://gitlab.com/nightlycommit/twing-loader
12 stars 13 forks source link

interpolation in include statements #38

Open pixelrabbit opened 2 years ago

pixelrabbit commented 2 years ago

twing-loader does not seem to support interpolation when used in an include statement

This works {% include "./test.twig" %}

This does not work {% set filename = "test" %} {% include "/#{filename}.twig" %}

Regular interpolation in a paragraph string does work however so I believe it's related to order of operations. This is the error I receive in storybook.

TwingErrorLoader: Template "/test.twig" is not defined in "C:/Users/dango/Development/twigbook/components/Example/Example.twig" at line 7.

Any help you can provide is appreciated.