Skip to content
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 fragments so part of template can be reused #537

Open
Nairda015 opened this issue Feb 27, 2024 · 2 comments
Open

Add fragments so part of template can be reused #537

Nairda015 opened this issue Feb 27, 2024 · 2 comments
Labels

Comments

@Nairda015
Copy link

Hey there is a lot of going around HTMX and it would be cool if scribal can support fragments feature similar to this php directive https://laravel-news.com/laravel-htmx

@xoofx
Copy link
Member

xoofx commented Mar 4, 2024

Looks like fragment is just an indirection with inlining. The closest built-in is maybe wrap here otherwise you could define your own. I don't think there is a need to change anything in Scriban to provide such support.

@xoofx xoofx added the question label Mar 4, 2024
@atlemann
Copy link

atlemann commented Jun 4, 2024

I started using HTMX lately and this great library for templating. It would be great to avoid having to split my HTML into tiny fragments in different files making it really hard to reason about. Fragments would be great!

You mention defining your own. How would I go about doing that? What would it look like in scriban to do something like mentioned here https://htmx.org/essays/template-fragments/?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants