Skip to content

Instantly share code, notes, and snippets.

@PinkyJie
Last active December 26, 2015 12:09
Show Gist options
  • Save PinkyJie/7149607 to your computer and use it in GitHub Desktop.
Save PinkyJie/7149607 to your computer and use it in GitHub Desktop.
jekyll首页:分页与摘要
---
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> &nbsp;
<i class="icon-calendar"></i> <span>{{ post.date | date:"%Y-%m-%d" }}</span> &nbsp;
{% 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 %}
&nbsp;
{% 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">阅读全文 &raquo;</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="/">&laquo;</a></li>
{% if paginator.previous_page %}
{% if paginator.previous_page == 1 %}
<li><a href="/" class="current">&lt;</a></li>
{% else %}
<li><a href="/page{{paginator.previous_page}}/">&lt;</a></li>
{% endif %}
{% else %}
<li class="disabled"><a>&lt;</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}}/">&gt;</a></li>
{% else %}
<li class="disabled"><a>&gt;</a></li>
{% endif %}
<li><a href="/page{{paginator.total_pages}}/">&raquo;</a></li>
</ul>
</div>
<br />
<br />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment