blog/themes/cmd/layout/archive.njk
thisLight 781759d545 move cmd to nunjucks & update hexo to 6.0.0
Other changes:
* minor fix to the display for code blocks
* remove floating when hover on cards
* replace the list of tags and categories to the index page one
* small change on the title of tags' and categories' pages
2021-12-31 18:07:40 +08:00

74 lines
1.6 KiB
Text

{% extends 'includes/layout.njk' %}
{% block body %}
{% set categoriesList = list_categories({ show_count: false }) %}
{% set tagsList = list_tags({ show_count: false }) %}
{% set archivesList = list_archives({ show_count: false }) %}
{% if not is_year() %}
<div id="archive">
<h1>Archives</h1>
{% if theme.atom %}
<p>
The feed is available via
<a href="{{ theme.atom }}">atom</a>.
</p>
<br>
{% endif %}
{% if config.atom %}
<p>
The feed is available via
<a href="{{ config.atom }}">atom</a>.
</p>
<br>
{% endif %}
<aside>
<h2>Categories</h2>
{% if categoriesList %}
{{ categoriesList | safe}}
{% else %}
<p>None.</p>
{% endif %}
</aside>
<br>
<aside>
<h2>Tags</h2>
{% if tagsList %}
{{ tagsList | safe }}
{% else %}
<p>None.</p>
{% endif %}
</aside>
<br>
<aside>
<h2>Archives</h2>
{% if archivesList %}
{{ archivesList | safe }}
{% else %}
<p>None.</p>
{% endif %}
</aside>
</div>
{% else %}
<h1>{{ page.month + '/' + page.year }}</h1>
{% for postItem in page.posts.toArray() %}
<div class="archive-item">
<a href="{{ url_for(postItem.path) }}">
{{ postItem.title }}
</a>
<time datetime="{{ date_xml(postItem.date) }}">
{{ date(postItem.date) }}
</time>
</div>
{% endfor %}
<div id="paginator">
{{ paginator() }}
</div>
{% endif %}
{% endblock %}