mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Remove some excessive newlines from generated HTML
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
{% macro post_link(page) %}
|
||||
<div>
|
||||
{% set translations = page.translations | filter(attribute="lang", value=lang) %}
|
||||
{% if translations %}
|
||||
{% set post = get_page(path = translations.0.path) %}
|
||||
{% else %}
|
||||
{% set post = page %}
|
||||
{% set not_translated = true %}
|
||||
{% endif %}
|
||||
{% set translations = page.translations | filter(attribute="lang", value=lang) -%}
|
||||
{%- if translations -%}
|
||||
{%- set post = get_page(path = translations.0.path) -%}
|
||||
{%- else -%}
|
||||
{%- set post = page -%}
|
||||
{%- set not_translated = true -%}
|
||||
{%- endif -%}
|
||||
<h2 class="post-title"><a href="/{{ post.path | safe }}">{{ post.title }}</a></h2>
|
||||
<div class="post-summary">
|
||||
{{ post.summary | safe}}
|
||||
{{ post.summary | safe }}
|
||||
<a class="read-more" href="/{{ post.path | safe }}"><em>read more »</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">
|
||||
(This post is not translated yet.)
|
||||
</aside>
|
||||
{% endif %}
|
||||
{%- endif -%}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro post_link %}
|
||||
|
||||
@@ -24,21 +24,21 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{% set chapter = "none" %}
|
||||
{% for post in posts %}
|
||||
{% if post.extra["chapter"] %}
|
||||
{% if post.extra["chapter"] != chapter %}
|
||||
{%- set chapter = "none" -%}
|
||||
{%- for post in posts -%}
|
||||
{%- if post.extra["chapter"] -%}
|
||||
{%- if post.extra["chapter"] != chapter -%}
|
||||
{# Begin new chapter #}
|
||||
{% set_global chapter = post.extra["chapter"] %}
|
||||
{%- set_global chapter = post.extra["chapter"] -%}
|
||||
</div>
|
||||
|
||||
<div id="{{chapter | slugify}}" class="post-category {{chapter | slugify}}">{{ chapter }}</div>
|
||||
<div class="posts {{chapter | slugify}}">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
{{ macros::post_link(page=post) }}
|
||||
{% endfor %}
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
|
||||
<div class="posts subscribe">
|
||||
|
||||
Reference in New Issue
Block a user