Loop through all jekyll posts and display an excerpt

Categories:  Web
Labels:  html, jekyll

Displaying an excerpt of each entry in the category page is a good practice to improve the visibility of your web pages, because the user can get an better idea of the content quickly. Also this improves the positioning in the search engines and the presentation, giving to your web page a more professional look.

partial: all

{% for post in site.posts %}
<div class="row">
	<div class="small-12 columns">

		<sub>{{ post.date | date: '%B %d, %Y' }}</sub>
		<a href="{{ post.url }}"><h3>{{ post.title }}</h3></a>

		{{ post.excerpt }}

		<ul class="inline-list" style="margin-top:-1em;">
			{% for category in post.categories %}
			<li><h6><a href="/#!/{{ category }}"><i class="fa fa-tag"></i> {{ category }}</a></h6></li>
			{% endfor %}

{% endfor %}

Here is this great code in jekyll. I have it working in this web, and goes fine :p :

Link to source code

Related Posts: