-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Override-able template "blocks" #245
Comments
@jcs224 this should be possible currently by defining a custom function, |
Awesome, thanks! I looked in the documentation for some help on how to get started with using |
@jcs224 I don't have an example right off hand, and am a bit too busy with work to draft one up right now -- sorry 😬. If you're able to get something working, please comment here and share it with others! |
I've checked the source code, and if I read everything correctly, I don't see how this would be possible with the |
Is your feature request related to a problem? Please describe.
There are instances where I'd like to be able to override default content of a template cleanly, such as including different scripts and styles on a different page, or showing different navigation from the default.
Describe the solution you'd like
Here is a basic example of what the desired behavior might look like. In this case, overriding a script. Here is the layout:
And here is a sub-template, utilizing the above layout:
Describe alternatives you've considered
I've looked at other JS templating engines, but this fits my needs best based on the runtime flexibility and most of the features I need are available.
Additional context
Here are some existing templating engine's examples that might provide additional context:
https://mozilla.github.io/nunjucks/templating.html#block
https://laravel.com/docs/10.x/blade#layouts-using-template-inheritance
The text was updated successfully, but these errors were encountered: