Skip to content

Instantly share code, notes, and snippets.

@yulijia
Created January 18, 2015 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yulijia/2f865b78a28bfe9e0a81 to your computer and use it in GitHub Desktop.
Save yulijia/2f865b78a28bfe9e0a81 to your computer and use it in GitHub Desktop.
[Jekyll] How to create post summary in Freshman21 theme
---
published: true
title: how to create post summary
layout: post
summary: This post show us how to create a post summary step by step.
author: Yu
category: howto
tags:
- summary
---
content.
---
layout: default
---
<div class="home">
<div class="post">
{% for post in paginator.posts %}
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
</h1>
<p class="post-meta">
{{ site.locales[site.default_locale].PostedInCategories }}
{% for cat in post.categories %}
<a href="{{site.url}}/categories/#{{ cat }}">{{ cat }}</a>&nbsp;
{% endfor %}
{% if post.tags != empty %}
{{ site.locales[site.default_locale].Taggedwith }}
{% for tag in post.tags %}
<a href="{{ site.url }}/tags/#{{ tag }}" title="{{ tag }}">{{ tag }} </a>{% unless post.tags.last == tag %}, {% endunless %}
{% endfor %}
{% endif %}
{{ site.locales[site.default_locale].PostDate }}{{ post.date | date: "%b %-d, %Y" }}
</p>
</header>
<article class="post-content">
{{ post.summary }}
<p><a href="{{ post.url | prepend: site.baseurl }}">read more</a></p>
</article>
<hr />
{% endfor %}
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment