How do you use partial layouts in pystache? I haven’t been able to find any documentation for doing this. I’m looking for something along the lines of
layout.html
<html>
<body>
{{<body}}
</body>
</html>
index.html
<section>
{{name}}
</section>
Edit:
I’ve done this using node.js and am familiar with the templating syntax, but I’m not sure how to tell pystache to load both files.
Pystache is just a Python implementation of Mustache, so the Mustache documentation should apply to Pystache as well. Check out the Partials section of the man page.
layout.mustachebody.mustacheHere’s an example of rendering the above templates in Pystache (from the same directory as the
.mustachefiles):For more info, check out the Pystache source.