Customize layouts with Selmer
masterCryogen uses the Selmer templating engine. Layout files are located in themes/{theme}/html/.
Layout Structure
- Base Layout:
base.htmlis the primary layout. Use this to define global assets (CSS/JS), headers, and footers. - Page Layouts: Specific layouts (e.g.,
tag.html) should extend the base layout using{% extends "/html/base.html" %}and wrap their unique content in a{% block content %}block. - Metadata Mapping: Each page's metadata
:layoutkey must match the filename of the layout (e.g.,:layout "tag"maps totag.html).
Example tag.html layout:
{% extends "/html/base.html" %}
{% block content %}
<div id="posts-by-tag">
<h2>Posts tagged {{name}}</h2>
<ul
{% for post in posts %}
<li>
<a href="{{post.uri}}">{{post.title}}</a>
</li>
{% endfor %}
</ul>
</div>
{% endblock %}