-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for Twig functions #10
Conversation
This looks good to me There's some test twig files and it would be good to add one for this functionality |
I wonder if we should change it from 'activeTheme' to a more generic 'globalContexts' that allows passing other values too? |
c9b69b1
to
18f4f3c
Compare
18f4f3c
to
ddd634e
Compare
The final code uses |
Nice one, thank you for adding the tests, I hadn't got round to looking at them yet. I wasn't aware of |
I added global context here too 👍
…On Tue, 9 Jan 2024, 6:20 pm Paul Sebborn, ***@***.***> wrote:
Nice one, thank you for adding the tests, I hadn't got round to looking at
them yet. I wasn't aware of globalContext - nice learning for me :)
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEHR5WM2P7PQTZKAKL5ISTYNT4TLAVCNFSM6AAAAABBOESOKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBSGU4TMNZXGY>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
This fixes #9 , adding support for custom functions.
Usage gudelines:
Add a
functions
object to the Twig constructor, and pass the custom functions you need into there. Use as normal within Twig templates!(NB. I also added the ability for passing in the 'active theme' as sometimes I've used that in projects, and it can be helpful)