PatternLab Twig Extension Plugin
Adds the ability to load custom Twig extensions into PatternLab., (*1)
Installation
Add the plugin as a dependency using Composer., (*2)
composer require ricovandevin/patternlab-twig-extensions-plugin
, (*3)
Create a folder 'extensions' inside the '_twig-components' folder of your PatternLab source folder, e.g., (*4)
mkdir src/_twig-components/extensions
, (*5)
You can now place the source code of the Twig extensions you want to include in this folder. To manage them
with Composer and automatically place them in the right location use the composer/installers package, (*6)
composer require composer/installers
, (*7)
and add this inside your composer.json, (*8)
"extra": {
"installer-paths": {
"src/_twig-components/extensions": [
"VENDOR/PROJECT"
]
}
}