@@ -21,7 +21,7 @@ modules, components, molecules). You can access the atoms in twig using the
2121following syntax:
2222
2323``` twig
24- {% x:my-atom %}{% endx %}
24+ {% x:my-atom %}
2525```
2626
2727The above will include ` _atoms/my-atom ` in your template. If ` my-atom `
@@ -34,7 +34,7 @@ current template context is NOT passed to the atom, so any variables defined
3434outside will have to be passed manually.
3535
3636``` twig
37- {% x:my-atom { heading: "Hello world!" } %}{% endx %}
37+ {% x:my-atom { heading: "Hello world!" } %}
3838```
3939
4040In the above example, ` my-atom ` will be given access to the ` heading ` variable.
@@ -50,7 +50,7 @@ Children can also be passed to atoms:
5050 <p>This is my atom</p>
5151 <p>There are many like it, but this is mine</p>
5252 <p>{{ myVariable }}</p>
53- {% endx %}
53+ {% endx:my-atom %}
5454```
5555
5656Children are rendered in the parent context, not the atoms. This means any
@@ -75,8 +75,8 @@ Atoms can be nested inside other atoms!
7575
7676``` twig
7777{% x:my-atom %}
78- {% x:another-atom %}{% endx %}
79- {% endx %}
78+ {% x:another-atom %}
79+ {% endx:my-atom %}
8080```
8181
8282### Sub-folders
@@ -86,7 +86,7 @@ you had an atom at `_atoms/cards/news`, you could access it using the following
8686syntax:
8787
8888``` twig
89- {% x:cards/news %}{% endx %}
89+ {% x:cards/news %}
9090```
9191
9292### Dynamic Atoms
@@ -97,7 +97,11 @@ brackets:
9797``` twig
9898{% set myVar = 'example-atom' %}
9999
100- {% x:[myVar] %}{% endx %}
100+ {% x:[myVar] %}
101+
102+ {% x:[myVar] %}
103+ <p>hello world!</p>
104+ {% endx:[myVar] %}
101105```
102106
103107## Config
0 commit comments