Replies: 3 comments
-
I'm afraid that this is wrongly documented in the README. If you want you can fix it via PR.
Did you include the
If still not working, could you share a minimal working example for reproducing this? |
Beta Was this translation helpful? Give feedback.
-
Fix the readme but I've realised it's not working because I'm using partial includes to build up my pages. Is there a way of making it work in that way? |
Beta Was this translation helpful? Give feedback.
-
Hi @howdu, Thanks for the PR. Why is this required? The context is used to pass a "bag" with all the icons that are used on site. This is needed because the SVG data is rendered all at once, at a different place by default. For complicated setups I would recommend the Data Pattern which requires maintaining a separate Last resort alternative would be to use the inline loader, but then you'll loose some advantages of the symbol approach ( Hope this gives some insights. |
Beta Was this translation helpful? Give feedback.
-
{{ partial "icon" (context . name "fas heart") }}
This semi-works
{{ partial "icon" (dict "context" . "name" "fas heart") }}
But svg is not included even though it's last.
Checking the html is added inline correctly but not the referenced svg:
<svg class="icon"><use xlink:href="#icon-heart"></use></svg>
Beta Was this translation helpful? Give feedback.
All reactions