Last active
December 26, 2015 12:09
-
-
Save PinkyJie/7149607 to your computer and use it in GitHub Desktop.
jekyll首页:分页与摘要
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: page | |
title: 进击的马斯特 | |
tagline: Go Fighting! Master! | |
--- | |
{% for post in paginator.posts %} | |
<div class="post-wrapper"> | |
<h2 class="h2 entry-title"> | |
<a href="{{ post.url }}">{{ post.title }}</a> | |
</h2> | |
<div class="entry-meta"> | |
<i class="icon-user"></i> <span>{{ post.author }}</span> | |
<i class="icon-calendar"></i> <span>{{ post.date | date:"%Y-%m-%d" }}</span> | |
{% unless post.categories == empty %} | |
<i class="icon-bookmark"></i> | |
{% for category in post.categories %} | |
<a href="/categories.html#{{ category }}-ref" target="_blank"> | |
<span class="label post-category">{{ category }}</span> | |
</a> | |
{% endfor %} | |
{% endunless %} | |
| |
{% unless post.tags == empty %} | |
<i class="icon-tag"></i> | |
{% for tag in post.tags %} | |
<a href="/tags.html#{{ tag }}-ref" target="_blank"> | |
<span class="label post-tag">{{ tag }}</span> | |
</a> | |
{% endfor %} | |
{% endunless %} | |
</div> | |
<br /><br /> | |
<div class="entry"> | |
{{ post.content | split: '<!--more-->' | first }} | |
<p> | |
<a href="{{ post.url }}/#more" class="more-link btn"> | |
<span class="readmore">阅读全文 »</span> | |
</a> | |
</p> | |
</div> | |
</div> | |
<br /> | |
{% endfor %} | |
<!-- Pagination links --> | |
<div class="pagination pagination-centered"> | |
<hr /> | |
<ul> | |
<li class="disabled"><a>{{ paginator.page }} / {{ paginator.total_pages }}</a></li> | |
<li><a href="/">«</a></li> | |
{% if paginator.previous_page %} | |
{% if paginator.previous_page == 1 %} | |
<li><a href="/" class="current"><</a></li> | |
{% else %} | |
<li><a href="/page{{paginator.previous_page}}/"><</a></li> | |
{% endif %} | |
{% else %} | |
<li class="disabled"><a><</a></li> | |
{% endif %} | |
{% for count in (2..paginator.total_pages) limit:6 %} | |
{% if count == paginator.page %} | |
<li class="active"><a>{{count}}</a></li> | |
{% else %} | |
<li><a href="/page{{count}}/">{{count}}</a></li> | |
{% endif %} | |
{% endfor %} | |
{% if paginator.next_page %} | |
<li><a href="/page{{paginator.next_page}}/">></a></li> | |
{% else %} | |
<li class="disabled"><a>></a></li> | |
{% endif %} | |
<li><a href="/page{{paginator.total_pages}}/">»</a></li> | |
</ul> | |
</div> | |
<br /> | |
<br /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment