1
0
Fork 0
This repository has been archived on 2021-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
dennogumi.org-archive/_includes/list-posts.html
Moritz »mo.« Sauer 25dab72954 update css
2015-01-12 22:46:49 +01:00

53 lines
1.8 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% comment %}
Possible parameter for this loop:
entries
offset
category
Example for Category: {% include list-posts.html entries='3' offset='1' category='design' %}
Example for Tag: {% include list-posts.html entries='5' tag='terminal' %}
This loop works like this:
1. First we check if there was given a category for filtering if include.categories == NULL
2. If no category is given for filtering do a general loop.
3. If a category was given, assign category the given category to the variable category assign category = include.categories
{% endcomment %}
{% assign category = include.category %}
{% assign tag = include.tag %}
<ul class="side-nav">
{% if category == NULL and tag == NULL %}
{% for post in site.posts limit:include.entries offset:include.offset %}
<li><a href="{{ site.url }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} &middot; {% endif %}<strong>{{ post.title }}</strong></a></li>
{% endfor %}
<li class="text-right"><a href="{{ site.url }}/blog/archive/"><strong>{{ site.data.language.more }}</strong></a></li>
{% elsif category %}
{% for post in site.categories.[category] limit:include.entries offset:include.offset %}
<li><a href="{{ site.url }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} &middot; {% endif %}<strong>{{ post.title }}</strong></a></li>
{% endfor %}
<li class="text-right"><a href="{{ site.url }}/blog/archive/"><strong>{{ site.data.language.more }}</strong></a></li>
{% elsif tag %}
{% for post in site.tags.[tag] limit:include.entries %}
<li><a href="{{ site.url }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} &middot; {% endif %}<strong>{{ post.title }}</strong></a></li>
{% endfor %}
{% endif %}
</ul>