-
-
Save caraya/9129596f9aa554a8bb8c to your computer and use it in GitHub Desktop.
[Jekyll] How to create post summary in Freshman21 theme
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
--- | |
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. |
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: 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> | |
{% 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