-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Find a way to avoid too much nesting when using Qute #33251
Comments
You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip
|
/cc @mkouba (qute) |
Why is frontmatter something to tie into qute? |
Those would be different extensions as to be able to do this you have to tie it to the underlying template engine AFAIK |
yes - hence its not really a qute thing; but a "blog-generator" thing. Like, what is the usecase for the notion of frontmatters only on qute templates? and would it fit into quarkus typesafe templates etc? |
for the first question I think other frontmatter extension could also make sense, but Qute is the one I use with Quarkus. For the secodn question about type safety, @mkouba might know more |
As I explained in the zulip discussion - I think that the best way to implement this would be to add a custom content filter that would modify the template before it's parsed. Basically, replace the frontmatter with qute tags. This should not affect type-safe templates. However, keep in mind that similar solutions can be brittle... |
I already proposed a shorter syntax in #8750 a long time ago, and lost that battle:
That looks more Qute-spirited and shorter than frontmatter ;) |
@FroMage +1 - expanding/simplifying the syntax of Qute's ability to composite templates makes more sense to me than adding a "flat" frontmatter. |
Well, I don't find this proposal more readable or even Qute-spirited and it definitely does not follow the current syntax rules. And BTW this particular example could be simplified like:
and then in the base |
This is joining something I am not a fan of, everything has to be nested in Qute, even when declaring variables with Maybe we should have a syntax to change the current context? This way we could set an include and it's params without nesting? |
Yes, the idea is that the tag defines the scope of the variable. For
We could relax this requirement and make the end tag optional for some sections. We already do that for the nested blocks in the So that if you use |
Ah that could be a solution indeed (for both problems), I would auto-add the end tag at the end of the current section though (not the end of the template) |
Then we could just do: {#include base title='My Title'}
<p>blahblah</p>
{#for item in items}
{#let foo = item.price}
<li>{item.name} {#if item.active}{foo}{/if}</li>
{/for} |
I would be happy with such a happy ending :) |
👍 |
FYI I've created #33293 |
Closing this issue as #33296 was merged. Feel free to reopen if necessary. |
Description
Interested in this extension, please +1 via the emoji/reaction feature of GitHub (top right).
could be replaced by:
Repository name
quarkus-qute-frontmatter
Short description
Allow to use frontmatter alongside Qute to make layout a bit simpler
Repository Homepage URL
https://quarkiverse.github.io/quarkiverse-docs/quarkus-qute-frontmatter/dev/
Repository Topics
Team Members
Additional context
Zulip discussion: https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/Frontmatter.20extension.20for.20Qute
The text was updated successfully, but these errors were encountered: