|
1 | 1 | {% comment %} |
2 | | -* |
| 2 | +* |
3 | 3 | * Possible parameter for this loop: |
4 | | -* |
| 4 | +* |
5 | 5 | * › entries |
6 | 6 | * › offset |
7 | 7 | * › category |
8 | 8 | * › tag |
9 | | -* |
| 9 | +* |
10 | 10 | * Example for Category: {% include list-posts entries='3' offset='1' category='design' %} |
11 | | -* |
| 11 | +* |
12 | 12 | * Example for Tag: {% include list-posts entries='5' tag='terminal' %} |
13 | | -* |
14 | | -* |
| 13 | +* |
| 14 | +* |
15 | 15 | * This loop works like this: |
16 | | -* |
17 | | -* 1. First we check if there was given a category for filtering › if include.categories == NULL |
| 16 | +* |
| 17 | +* 1. First we check if there was given a category for filtering › if include.categories == NULL |
18 | 18 | * 2. If no category is given for filtering do a general loop. |
19 | | -* 3. If a category/tag was given, assign category/tag to the variable category/tag › assign category = include.categories |
20 | | -* |
| 19 | +* 3. If a category/tag was given, assign category/tag to the variable category/tag › assign category = include.categories |
| 20 | +* |
21 | 21 | {% endcomment %} |
22 | 22 |
|
23 | 23 |
|
|
29 | 29 | {% if category == NULL and tag == NULL %} |
30 | 30 |
|
31 | 31 | {% for post in site.posts limit:include.entries offset:include.offset %} |
32 | | - <li><a href="{{ site.url }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} · {% endif %}<strong>{{ post.title }}</strong></a></li> |
| 32 | + <li><a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} · {% endif %}<strong>{{ post.title }}</strong></a></li> |
33 | 33 | {% endfor %} |
34 | | - <li class="text-right"><a href="{{ site.url }}/blog/archive/"><strong>{{ site.data.language.more }}</strong></a></li> |
| 34 | + <li class="text-right"><a href="{{ site.url }}{{ site.baseurl }}/blog/archive/"><strong>{{ site.data.language.more }}</strong></a></li> |
35 | 35 |
|
36 | 36 |
|
37 | 37 | {% elsif category %} |
38 | | - |
| 38 | + |
39 | 39 | {% for post in site.categories.[category] limit:include.entries offset:include.offset %} |
40 | | - <li><a href="{{ site.url }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} · {% endif %}<strong>{{ post.title }}</strong></a></li> |
| 40 | + <li><a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} · {% endif %}<strong>{{ post.title }}</strong></a></li> |
41 | 41 | {% endfor %} |
42 | | - <li class="text-right"><a href="{{ site.url }}/blog/archive/"><strong>{{ site.data.language.more }}</strong></a></li> |
| 42 | + <li class="text-right"><a href="{{ site.url }}{{ site.baseurl }}/blog/archive/"><strong>{{ site.data.language.more }}</strong></a></li> |
43 | 43 |
|
44 | 44 |
|
45 | 45 | {% elsif tag %} |
46 | 46 |
|
47 | 47 | {% for post in site.tags.[tag] limit:include.entries %} |
48 | | - <li><a href="{{ site.url }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} · {% endif %}<strong>{{ post.title }}</strong></a></li> |
| 48 | + <li><a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} · {% endif %}<strong>{{ post.title }}</strong></a></li> |
49 | 49 | {% endfor %} |
50 | 50 |
|
51 | 51 | {% endif %} |
|
0 commit comments