diff --git a/packages/edition-twig/alter-twig.php b/packages/edition-twig/alter-twig.php index 0c7c2918c..425775ae6 100644 --- a/packages/edition-twig/alter-twig.php +++ b/packages/edition-twig/alter-twig.php @@ -1,15 +1,17 @@ Hello {{ customTwigFunctionThatSaysWorld() }}!` => `

Hello Custom World

` */ -// $env->addFunction(new \Twig_SimpleFunction('customTwigFunctionThatSaysWorld', function () { +// $env->addFunction(new TwigFunction('customTwigFunctionThatSaysWorld', function () { // return 'Custom World'; // })); @@ -18,7 +20,7 @@ function addCustomExtension(\Twig_Environment &$env, $config) { * @param string $theString * @example `

{{ reverse('abc') }}

` => `

cba

` */ -// $env->addFunction(new \Twig_SimpleFunction('reverse', function ($theString) { +// $env->addFunction(new TwigFunction('reverse', function ($theString) { // return strrev($theString); // })); @@ -29,6 +31,5 @@ function addCustomExtension(\Twig_Environment &$env, $config) { // $env->addGlobal('foo', 'bar'); // example of enabling the Twig debug mode extension (ex. {{ dump(my_variable) }} to check out the template's available data) -- comment out to disable - // $env->addExtension(new \Twig_Extension_Debug()); - + // $env->addExtension(new Twig\Extension\DebugExtension()); } diff --git a/packages/edition-twig/source/_patterns/atoms/buttons/button-dark-demo.twig b/packages/edition-twig/source/_patterns/atoms/buttons/button-dark-demo.twig index 636b15686..5a61b3cb7 100644 --- a/packages/edition-twig/source/_patterns/atoms/buttons/button-dark-demo.twig +++ b/packages/edition-twig/source/_patterns/atoms/buttons/button-dark-demo.twig @@ -1,4 +1,4 @@ -{% include '@atoms/buttons/_button.twig' with { +{% include '@atoms/buttons/button.twig' with { text: 'Click Me', dark: true, } only %} diff --git a/packages/edition-twig/source/_patterns/atoms/buttons/button-simple-demo.twig b/packages/edition-twig/source/_patterns/atoms/buttons/button-simple-demo.twig index ae1350317..81cf5f6cb 100644 --- a/packages/edition-twig/source/_patterns/atoms/buttons/button-simple-demo.twig +++ b/packages/edition-twig/source/_patterns/atoms/buttons/button-simple-demo.twig @@ -1,3 +1,3 @@ -{% include '@atoms/buttons/_button.twig' with { +{% include '@atoms/buttons/button.twig' with { text: 'Click Me', } only %} diff --git a/packages/edition-twig/source/_patterns/atoms/buttons/button.md b/packages/edition-twig/source/_patterns/atoms/buttons/button.md new file mode 100644 index 000000000..683af9f1a --- /dev/null +++ b/packages/edition-twig/source/_patterns/atoms/buttons/button.md @@ -0,0 +1,3 @@ +--- +hidden: true +--- diff --git a/packages/edition-twig/source/_patterns/atoms/buttons/_button.twig b/packages/edition-twig/source/_patterns/atoms/buttons/button.twig similarity index 100% rename from packages/edition-twig/source/_patterns/atoms/buttons/_button.twig rename to packages/edition-twig/source/_patterns/atoms/buttons/button.twig diff --git a/packages/edition-twig/source/_patterns/atoms/text/headings.twig b/packages/edition-twig/source/_patterns/atoms/text/headings.twig index 2ecbbf0c5..deb727bab 100644 --- a/packages/edition-twig/source/_patterns/atoms/text/headings.twig +++ b/packages/edition-twig/source/_patterns/atoms/text/headings.twig @@ -1,6 +1,6 @@

Heading Level 1

Heading Level 2

-

Heading Level 3

+

Heading Level 3

Heading Level 4

-
Heading Level 5
+
Heading Level 5
Heading Level 6
diff --git a/packages/edition-twig/source/_patterns/molecules/card/card.twig b/packages/edition-twig/source/_patterns/molecules/card/card.twig index d18f0069c..dbea5a7a8 100644 --- a/packages/edition-twig/source/_patterns/molecules/card/card.twig +++ b/packages/edition-twig/source/_patterns/molecules/card/card.twig @@ -1,6 +1,6 @@

Card Title here

- {% include '@atoms/buttons/_button.twig' with { + {% include '@atoms/buttons/button.twig' with { text: 'some text from card' } only %}
diff --git a/packages/engine-twig-php/package.json b/packages/engine-twig-php/package.json index 6cea65c13..760572a93 100644 --- a/packages/engine-twig-php/package.json +++ b/packages/engine-twig-php/package.json @@ -4,7 +4,7 @@ "version": "6.0.1", "main": "lib/engine_twig_php.js", "dependencies": { - "@basalt/twig-renderer": "^2.0.0", + "@basalt/twig-renderer": "^3.0.1", "@pattern-lab/core": "^6.0.1", "chalk": "^4.1.0", "fs-extra": "10.0.0" diff --git a/yarn.lock b/yarn.lock index 8adc07372..2c2a75401 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1121,10 +1121,10 @@ "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" -"@basalt/twig-renderer@^2.0.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@basalt/twig-renderer/-/twig-renderer-2.1.0.tgz#951e524fe1c75b37242d28d5b9552c9b1cce807b" - integrity sha512-27+8D3xJa8ht9ngo8FGsN76thAlQGsNiq5VF+rQX/aV93aGOneHGG900Tj0GqeZTKJ+F3s1O8I13JV0jcECByw== +"@basalt/twig-renderer@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@basalt/twig-renderer/-/twig-renderer-3.0.1.tgz#6c75dca804ed917483b3028f2bfd4130173e5c20" + integrity sha512-pLZeVxdwohW0Y3yXxnEpvJahoGPe5MSbvspeYVKMaVvUZnFD90R4plYmvHcXrMBUCwmcPU4bIOXaV/TNzxS/hg== dependencies: "@babel/core" "^7.2.0" "@babel/preset-env" "^7.2.0"