#JEKYLL TIPS 💎.
List of posts with excerpt, description or full post content.
<ul>
{% for post in site.posts %}
<li>
<a href="{{ post.permalink }}">{{ post.title }}</a>
<p>{{ post.excerpt }}</p>
</li>
{% endfor %}
</ul>
<ul>
{% for post in site.posts %}
<li>
<a href="{{ post.permalink }}">{{ post.title }}</a>
<p>{{ content }}</p>
</li>
{% endfor %}
</ul>
<ul>
{% for post in site.posts %}
<li>
<a href="{{ post.permalink }}">{{ post.title }}</a>
<p>{{ post.description }}</p>
</li>
{% endfor %}
</ul>
<ul>
{% for post in site.page %}
<li>
<a href="{{ page.permalink }}">{{ page.title }}</a>
<p>{{ page.description }}</p>
</li>
{% endfor %}
</ul>
post
can be replaced with page
or even site
depending on your need.See Jekyll Docs for more details.
posts/pages
in a category
❤on _config.yml
add your index of categories:
categories: [bacon, dogs, cows, mull, stink]
on your page.md inside the front matter add one or more of the categories available in the _config.yml
---
layout: page
title: Stinky Trees
description: Mull Congress from stinky trees.
categories: [stink, mull]
---
on your template to get all the pages in the stink category you do:
{% for page in site.pages %}
{% if page.categories contains 'stink' %}
<div class="item">
<h3><a href="{{ page.url }}">
{{ page.title }}
</a></h3>
<p>{{page.description}}</p>
</div>
{% endif %}
{% endif %}