Skip to content

Commit f60e07b

Browse files
committed
Corrected Bug with {% capture %} instead {% assign %}
1 parent b128dc6 commit f60e07b

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

_includes/_footer.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h5 class="shadow-black">{{ service_item.menu_name }}</h5>
2727

2828
<ul class="no-bullet shadow-black">
2929
{% for service_item in site.data.services %}
30-
{% if service_item.url contains 'http' %}{% assign domain = '' %}{% else %}{% assign domain = site.url + site.baseurl %}{% endif %}
30+
{% if service_item.url contains 'http' %}{% assign domain = '' %}{% else %}{% capture domain %}{{ site.url }}{{ site.baseurl }}{% endcapture %}{% endif %}
3131
<li {% if service_item.class %}class="{{ service_item.class }}" {% endif %}>
3232
<a href="{{ domain }}{{ service_item.url }}" {% if service_item.url contains 'http' %}target="_blank" {% endif %} title="{{ service_item.title }}">{{ service_item.name }}</a>
3333
</li>
@@ -45,7 +45,7 @@ <h5 class="shadow-black">{{ network_item.menu_name }}</h5>
4545

4646
<ul class="no-bullet shadow-black">
4747
{% for network_item in site.data.network %}
48-
{% if network_item.url contains 'http' %}{% assign domain = '' %}{% else %}{% assign domain = site.url + site.baseurl %}{% endif %}
48+
{% if network_item.url contains 'http' %}{% assign domain = '' %}{% else %}{% capture domain %}{{ site.url }}{{ site.baseurl }}{% endcapture %}{% endif %}
4949
<li {% if network_item.class %}class="{{ network_item.class }}" {% endif %}>
5050
<a href="{{ domain }}{{ network_item.url }}" {% if network_item.url contains 'http' %}target="_blank" {% endif %} title="{{ network_item.title }}">{{ network_item.name }}</a>
5151
</li>

_includes/list-posts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{% comment %}
2-
*
2+
*
33
* Possible parameter for this loop:
4-
*
4+
*
55
* › entries
66
* › offset
77
* › category
88
* › tag
9-
*
9+
*
1010
* Example for Category: {% include list-posts entries='3' offset='1' category='design' %}
11-
*
11+
*
1212
* Example for Tag: {% include list-posts entries='5' tag='terminal' %}
13-
*
14-
*
13+
*
14+
*
1515
* 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
1818
* 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+
*
2121
{% endcomment %}
2222

2323

@@ -29,23 +29,23 @@
2929
{% if category == NULL and tag == NULL %}
3030

3131
{% for post in site.posts limit:include.entries offset:include.offset %}
32-
<li><a href="{{ site.url }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} &middot; {% endif %}<strong>{{ post.title }}</strong></a></li>
32+
<li><a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} &middot; {% endif %}<strong>{{ post.title }}</strong></a></li>
3333
{% 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>
3535

3636

3737
{% elsif category %}
38-
38+
3939
{% 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 }} &middot; {% endif %}<strong>{{ post.title }}</strong></a></li>
40+
<li><a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} &middot; {% endif %}<strong>{{ post.title }}</strong></a></li>
4141
{% 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>
4343

4444

4545
{% elsif tag %}
4646

4747
{% for post in site.tags.[tag] limit:include.entries %}
48-
<li><a href="{{ site.url }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} &middot; {% endif %}<strong>{{ post.title }}</strong></a></li>
48+
<li><a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}">{% if post.subheadline %}{{ post.subheadline }} &middot; {% endif %}<strong>{{ post.title }}</strong></a></li>
4949
{% endfor %}
5050

5151
{% endif %}

0 commit comments

Comments
 (0)