Replies: 1 comment 2 replies
-
Hi @cbirdsong , But why don't you just register icons and then use: {% include "socials/whatever.svg" %} or create your own twig registered function where you can do some custom looping if required? This way you could even mark icons as deprecated, changed etc. So in twig you would just use {{ get_icon('socials/whatever') }} Hope that sparks some ideas! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One of the template locations we register with Timber is for icon SVG files so we can just do
{% include "whatever.svg" %}
. It often becomes cleaner to group those into folders for different sources and use cases:Doing it this way means we have to go and update those directories anytime we reorganize the icons, something we could sidestep registering these with a glob:
Is there any reason to avoid doing that when registering directories with Timber/Twig? #1612 made me think it might cause performance issues, but:
(also open to any other suggestions for how to deal with this scenario more robustly)
Beta Was this translation helpful? Give feedback.
All reactions