Open elpiel opened 2 years ago
Have you looked into using include
to use snippets between these layouts?
My preference is to instead keep it simple, relying on composing using include
but I'm up for hearing use cases to explain why layouts of layouts would be needed.
Have you looked into using include to use snippets between these layouts?
I'm not OP but I can attest one of the greatest features of Hugo are layout inheritance. Without it it's not possible to build a DRY website or practice functional programming via composition in the UI.
Have you looked into using
include
to use snippets between these layouts?My preference is to instead keep it simple, relying on composing using
include
but I'm up for hearing use cases to explain why layouts of layouts would be needed.
Yeah, this is what the default layout is doing, but the crates one extends it to add more stuff:
It's not mandatory to have this feature but it's good to have.
Can you help me understand why nested layouts are such a great feature?
To me
This is compared to a layout built of snippets where you pick and choose the descriptive reuse elements you want.
The one value I see in layouts is maintaining the balanced start/end together rather than having separate includes for start/end, much like RAII in C++ and Rust or with
in Python. I can see us adding support for something that is a mix of Tera filter blocks and macros
{% define body content %}
<body>
{{ content }}
</body>
{% enddefine%}
{% body %}
Hello world!
{%endbody %}
Since I'm looking to replace
jekyll
with something that is built with Rust, I realised that it's not currently possible to have a layout that uses another layout.I tried extracting the frontmatter for the layer and making a look when rendering the document, however, I was unable to make it work.
Is this something you'd like to have in cobalt? I can open a draft PR if it is so.