blog/themes/cmd/layout/category.swig

56 lines
2.2 KiB
Text
Raw Normal View History

2020-12-27 13:17:29 +00:00
{% extends 'includes/layout.swig' %}
{% import "includes/paginator.swig" as P %}
{% import "includes/tags.swig" as T %}
2020-12-27 13:17:29 +00:00
{% block body %}
<div id="category">
<div class="card z-depth-0">
<h2 style="margin-left: 1rem; margin-bottom: 0;">{{page.category}}<i class="mdi mdi-tag" style="font-size: 2rem; color: #ee6e73;"></i></h2>
{% if site.data.theme.topic_rss and site.data.theme.topic_rss.category %}
{% set category_rss = site.data.theme.topic_rss.category %}
2021-08-30 07:36:17 +00:00
{% if category_rss.name_lowercase %}
2021-10-13 03:03:49 +00:00
{% set rss_name = page.category.toLowerCase() %}
2021-08-30 07:36:17 +00:00
{% else %}
2021-10-13 03:03:49 +00:00
{% set rss_name = page.category %}
2021-08-30 07:36:17 +00:00
{% endif %}
<div class="card-action">
{% if category_rss.atom_suffix %}
<a href="{{ full_url_for(category_rss.prefix + rss_name + category_rss.atom_suffix) }}">Feed (Atom)</a>
{% endif %}
{% if category_rss.rss_suffix %}
<a href="{{ full_url_for(category_rss.prefix + rss_name + category_rss.rss_suffix) }}">Feed (RSS)</a>
{% endif %}
</div>
{% endif %}
</div>
<ul class="collapsible popout">
{% for article in page.posts.toArray() %}
<li>
<div class="collapsible-header">
<div class="row" style="margin: 0;">
<div class="row" style="margin-left: 4px; margin-bottom: 0.5rem;"><div class="col s12"><h3 style="font-size: 1.2rem; margin: 0; margin-top: 8px;">{{article.title}}</h3></div></div>
<div class="row" style="margin-left: 0; margin-bottom: 0;"><div class="col s12">{{ T.PostTags(article) }}</div></div>
</div>
</div>
<div class="collapsible-body small-padding">
<div style="padding-left: 1rem">
<div class="mdi mdi-clock" style="padding-bottom: 8px">{{ date(article.date) }}</div>
</div>
<div class="entry">{{article.excerpt}}</div>
<div class="card z-depth-0">
<div class="card-action" style="padding-bottom: 0; padding-left: 14px;">
<a href="{% if article.link %}{{article.link}}{% else %}{{url_for(article.path)}}{% endif %}">Go To "{{article.title}}"</a>
</div>
</div>
2020-12-27 13:17:29 +00:00
</div>
</li>
2020-12-27 13:17:29 +00:00
{% endfor %}
</ul>
2020-12-27 13:17:29 +00:00
<div id="center">
{{ P.Paginiation() }}
</div>
2020-12-27 13:17:29 +00:00
</div>
{% endblock %}