blog/themes/cmd/layout/post.njk

41 lines
1.2 KiB
Text
Raw Normal View History

{% extends 'includes/layout.njk' %}
2020-12-27 13:17:29 +00:00
{% from 'includes/tags.njk' import PostTags with context%}
2020-12-29 09:33:08 +00:00
{% macro Gallery(photos) %}
<div class="row">
<div class="col">
{% set i = 0 %}
{% for p in photos %}
{% set i = i + 1 %}
<img onerror="M.toast({ html: 'Some photos could not be showed at the moment, please try again later.' });" src="{{p}}" data-caption="{{i}}" class="responsive-img materialboxed gallery-img" async />
{% endfor %}
</div>
</div>
{% endmacro %}
2020-12-27 13:17:29 +00:00
{% block body %}
2020-12-29 09:33:08 +00:00
<article id="post">
<div class="card">
<div class="card-content">
<span class="card-title">{{ page.title }}</span>
<div class="row">
<div class="col" style="padding-left:0;"><span class="mdi mdi-account">{{config.author}}</span></div>
<div class="col"><span class="mdi mdi-clock">{{date(page.date, 'YYYY/M/D')}}</span></div>
</div>
{{ PostTags(page) }}
{% if page.photos and page.photos.length > 0 %}
2020-12-29 09:33:08 +00:00
{{Gallery(page.photos)}}
{% endif %}
<div class="entry">
{{ page.content | safe }}
2020-12-29 09:33:08 +00:00
</div>
</div>
</div>
2020-12-27 13:17:29 +00:00
</article>
<div id="paginator">
{{ paginator() }}
</div>
{% endblock %}