Remove some excessive newlines from generated HTML

This commit is contained in:
Philipp Oppermann
2020-02-17 11:22:49 +01:00
parent 127f446856
commit 0e3635f98b
2 changed files with 18 additions and 18 deletions

View File

@@ -1,22 +1,22 @@
{% macro post_link(page) %} {% macro post_link(page) %}
<div> <div>
{% set translations = page.translations | filter(attribute="lang", value=lang) %} {% set translations = page.translations | filter(attribute="lang", value=lang) -%}
{% if translations %} {%- if translations -%}
{% set post = get_page(path = translations.0.path) %} {%- set post = get_page(path = translations.0.path) -%}
{% else %} {%- else -%}
{% set post = page %} {%- set post = page -%}
{% set not_translated = true %} {%- set not_translated = true -%}
{% endif %} {%- endif -%}
<h2 class="post-title"><a href="/{{ post.path | safe }}">{{ post.title }}</a></h2> <h2 class="post-title"><a href="/{{ post.path | safe }}">{{ post.title }}</a></h2>
<div class="post-summary"> <div class="post-summary">
{{ post.summary | safe}} {{ post.summary | safe }}
<a class="read-more" href="/{{ post.path | safe }}"><em>read&nbsp;more&nbsp;»</em></a> <a class="read-more" href="/{{ post.path | safe }}"><em>read&nbsp;more&nbsp;»</em></a>
{% if lang and not_translated and lang != config.default_language %} {%- if lang and not_translated and lang != config.default_language -%}
<aside class="no-translation"> <aside class="no-translation">
(This post is not translated yet.) (This post is not translated yet.)
</aside> </aside>
{% endif %} {%- endif -%}
</div> </div>
</div> </div>
{% endmacro post_link %} {% endmacro post_link %}

View File

@@ -24,21 +24,21 @@
</div> </div>
<div> <div>
{% set chapter = "none" %} {%- set chapter = "none" -%}
{% for post in posts %} {%- for post in posts -%}
{% if post.extra["chapter"] %} {%- if post.extra["chapter"] -%}
{% if post.extra["chapter"] != chapter %} {%- if post.extra["chapter"] != chapter -%}
{# Begin new chapter #} {# Begin new chapter #}
{% set_global chapter = post.extra["chapter"] %} {%- set_global chapter = post.extra["chapter"] -%}
</div> </div>
<div id="{{chapter | slugify}}" class="post-category {{chapter | slugify}}">{{ chapter }}</div> <div id="{{chapter | slugify}}" class="post-category {{chapter | slugify}}">{{ chapter }}</div>
<div class="posts {{chapter | slugify}}"> <div class="posts {{chapter | slugify}}">
{% endif %} {%- endif -%}
{% endif %} {%- endif -%}
{{ macros::post_link(page=post) }} {{ macros::post_link(page=post) }}
{% endfor %} {%- endfor -%}
</div> </div>
<div class="posts subscribe"> <div class="posts subscribe">