Fix commonmark compatibility in tags+posts.

This commit is contained in:
Michal Jirku 2020-11-24 13:37:48 +01:00
parent 4ecba529e9
commit 79d8a3351f
2 changed files with 22 additions and 22 deletions

View File

@ -10,22 +10,22 @@ permalink: /posts/
<div class="tags-header-line"></div>
</div>
<div class="tags-clouds">
{% for post in site.posts %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% if forloop.first %}<a href="#{{ this_year }}">{{ this_year }}</a>{% endif %}
{% unless forloop.last %}
{% if this_year != next_year %}<a href="#{{ next_year }}">{{ next_year }}</a>{% endif %}
{% endunless %}
{% endfor %}
{% for post in site.posts -%}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture -%}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture -%}
{% if forloop.first %}<a href="#{{ this_year }}">{{ this_year }}</a>{% endif -%}
{% unless forloop.last -%}
{% if this_year != next_year %}<a href="#{{ next_year }}">{{ next_year }}</a>{% endif -%}
{% endunless -%}
{% endfor -%}
</div>
{% for post in site.posts %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% if forloop.first %}
{% for post in site.posts -%}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture -%}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture -%}
{% if forloop.first -%}
<div class="tags-item" id="{{ this_year }}">
<h2 class="tags-item-label">{{ this_year }}</h2>
{% endif %}
{% endif -%}
<a class="tags-post" href="{{ post.url | prepend: site.baseurl }}">
<div>
<span class="tags-post-title">{{ post.title }}</span>
@ -37,14 +37,14 @@ permalink: /posts/
</time>
</span>
</a>
{% if forloop.last %}
{% if forloop.last -%}
</div>
{% else %}
{% if this_year != next_year %}
{% else -%}
{% if this_year != next_year -%}
</div>
<div class="tags-item" id="{{ next_year }}">
<h2 class="tags-item-label">{{ next_year }}</h2>
{% endif %}
{% endif %}
{% endfor %}
{% endif -%}
{% endif -%}
{% endfor -%}
</div>

View File

@ -10,11 +10,11 @@ permalink: /tags/
<div class="tags-header-line"></div>
</div>
<div class="tags-clouds">
{% for tag in site.tags %}
{% for tag in site.tags -%}
<a href="#{{ tag[0] }}">{{ tag[0] }}</a>
{% endfor %}
</div>
{% for tag in site.tags %}
{% for tag in site.tags -%}
<div class="tags-item" id="{{ tag[0] }}">
<svg
class="tags-item-icon"
@ -35,7 +35,7 @@ permalink: /tags/
<line x1="7" y1="7" x2="7.01" y2="7"></line>
</svg>
<h2 class="tags-item-label">{{ tag[0] }}</h2>
{% for post in tag[1] %}
{% for post in tag[1] -%}
<a class="tags-post" href="{{ post.url | prepend: site.baseurl }}">
<div>
<span class="tags-post-title">{{ post.title }}</span>