Skip to content

Instantly share code, notes, and snippets.

@yanping
Last active December 17, 2015 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yanping/5689265 to your computer and use it in GitHub Desktop.
Save yanping/5689265 to your computer and use it in GitHub Desktop.
jekyll对read more的原生支持
---
layout: default
title: Welcome to
isHome: true
---
<!--from https://github.com/jsw0528/MrZhang.me/blob/gh-pages/_index.html-->
{% for post in paginator.posts %}
<article class="entry" id="{{ post.id }}">
<header>
<h1 class="entry-title">
<a href="{{ post.url }}">{{ post.title }}</a>
</h1>
<p class="entry-meta">
<time class="iconfont-time">{{ post.date | date: '%Y/%m/%d %A' }}</time>
</p>
</header>
{% assign fragments = post.content | split: '<!-- more -->' %}
{% assign size = fragments | size %}
{{ fragments | first }}
{% if size > 1 %}<p><a href="{{ post.url }}">继续阅读 &rarr;</a></p>{% endif %}
</article>
{% endfor %}
{% include pagination.html %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment