|
|
|
|
|
by delluminatus
4527 days ago
|
|
What you're talking about can be pretty easily implemented with template inheritance that uses blocks/sections. Pretty much any templating language can do this for you (usually static site generators use templating languages, so by extension, static site generators will do this for you as well). For instance, jinja2 is a common one for Python that I use for my website. You can read about jinja2 template inheritance in their docs [1]. The gist of it is that you can define a layout in HTML, with placeholders for specific things like the title, author, content, etc. Then your actual post is just a file that inherits from that layout template and only defines the relevant blocks. So in "template pseudocode" your page might look like this: {{ extends site_layout }}
{{ block title }} Title here {{ endblock }}
{{ block author }} delluminatus {{ endblock }}
{{ block content }}
<p>Content!</p>
{{ endblock }}
[1]: http://jinja.pocoo.org/docs/templates/#template-inheritance |
|