mirror of
https://github.com/amehime/hexo-theme-shoka.git
synced 2026-04-05 18:49:07 +08:00
26 lines
744 B
Plaintext
26 lines
744 B
Plaintext
{% macro navpost(item, type) %}
|
|
{%- set postText = item.title or item.link or __('post.untitled') %}
|
|
{%- set lastcat = item.categories.last() %}
|
|
|
|
{%- set itemlink %}
|
|
<span class="type">{{__('post.' + type)}}</span>
|
|
<span class="category"><i class="ic i-flag"></i> {{lastcat.name}}</span>
|
|
<h3>{{ postText }}</h3>
|
|
{% endset %}
|
|
|
|
{{ _url(item.path, itemlink, {itemprop: 'url', rel: type, 'data-background-image': _cover(item), title: postText}) }}
|
|
{% endmacro %}
|
|
|
|
<div class="nav">
|
|
<div class="item left">
|
|
{%- if post.next %}
|
|
{{navpost(post.next, 'prev')}}
|
|
{%- endif %}
|
|
</div>
|
|
<div class="item right">
|
|
{%- if post.prev %}
|
|
{{navpost(post.prev, 'next')}}
|
|
{%- endif %}
|
|
</div>
|
|
</div>
|