-
Notifications
You must be signed in to change notification settings - Fork 102
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
A layout using another layout as a base #942
Comments
Have you looked into using My preference is to instead keep it simple, relying on composing using |
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. |
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 {% 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.
The text was updated successfully, but these errors were encountered: