Remove unnecessary white space

Adding a "-" before the "%}" removes white space after the statement.

Source: https://tera.netlify.app/docs#whitespace-control
This commit is contained in:
Che 2022-06-02 17:59:34 -04:00
parent 2871520111
commit e390130d26
2 changed files with 62 additions and 62 deletions

View file

@ -3,19 +3,19 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link rel="stylesheet" href="{{ get_url(path="main.css") | safe }}"> <link rel="stylesheet" href="{{ get_url(path="main.css") | safe }}">
{% if config.extra.favicon %} {% if config.extra.favicon -%}
{% set _favicon = config.extra.favicon %} {% set _favicon = config.extra.favicon -%}
{% if (_favicon is starting_with("http")) == false %} {% if (_favicon is starting_with("http")) == false -%}
{% set _favicon = get_url(path=config.extra.favicon) %} {% set _favicon = get_url(path=config.extra.favicon) -%}
{% endif %} {% endif -%}
<link rel="icon" href="{{ _favicon | safe }}"> <link rel="icon" href="{{ _favicon | safe }}">
{% endif %} {% endif -%}
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title>{% block title %}{{ config.title }}{% endblock title %}</title> <title>{% block title %}{{ config.title }}{% endblock title %}</title>
</head> </head>
<body> <body>
{% if config.extra.release %} {% if config.extra.release -%}
<script> <script>
fetch('{{ config.extra.release | safe }}') fetch('{{ config.extra.release | safe }}')
.then((response) => { .then((response) => {
@ -27,37 +27,38 @@
release.innerHTML = `<a href='${html_url}'>${release_name}</a>`; release.innerHTML = `<a href='${html_url}'>${release_name}</a>`;
}); });
</script> </script>
{% endif %} {% endif -%}
<main> <main>
{% block nav %} {% block nav -%}
<nav> <nav>
{% if config.extra.logo %} {% if config.extra.logo -%}
{% set _logo = config.extra.logo %} {% set _logo = config.extra.logo -%}
{% if (_logo is starting_with("http")) == false %} {% if (_logo is starting_with("http")) == false -%}
{% set _logo = get_url(path=config.extra.logo) %} {% set _logo = get_url(path=config.extra.logo) -%}
{% endif %} {% endif -%}
{% if current_path == "/" and not config.extra.easydocs_logo_always_clickable %} {% if current_path == "/" and not config.extra.easydocs_logo_always_clickable -%}
<img src="{{ _logo | safe }}" alt=""/> <img src="{{ _logo | safe }}" alt=""/>
{% else %}<a href="{{ config.base_url }}"> {% else -%}
<img src="{{ _logo | safe }}" alt=""/> <a href="{{ config.base_url }}">
</a> <img src="{{ _logo | safe }}" alt=""/>
{% endif %} </a>
{% endif -%}
{% else %} {% else -%}
<h1><a href="{{ config.base_url }}">{{ config.title }}</a></h1> <h1><a href="{{ config.base_url }}">{{ config.title }}</a></h1>
{% endif %} {% endif -%}
{% if config.extra.release %} {% if config.extra.release -%}
<div id="release"></div> <div id="release"></div>
{% endif %} {% endif -%}
<a href="javascript:void(0);" onclick="burger()" id="mobile" class="ms-Icon--GlobalNavButton"></a> <a href="javascript:void(0);" onclick="burger()" id="mobile" class="ms-Icon--GlobalNavButton"></a>
<div id="trees"> <div id="trees">
{% set section_ = get_section(path="_index.md") %} {% set section_ = get_section(path="_index.md") -%}
{% for p in section_.subsections %} {% for p in section_.subsections -%}
{% set subsection = get_section(path=p) %} {% set subsection = get_section(path=p) -%}
<input class="tree-toggle" type="checkbox" id="{{ subsection.title | slugify }}" <input class="tree-toggle" type="checkbox" id="{{ subsection.title | slugify }}"
@ -66,56 +67,56 @@
for="{{ subsection.title | slugify }}">{{ subsection.title }}</label> for="{{ subsection.title | slugify }}">{{ subsection.title }}</label>
<ul class="subtree"> <ul class="subtree">
{% for page in subsection.pages %} {% for page in subsection.pages -%}
<li {% if current_path == page.path %}class="active"{% endif %}> <li {% if current_path == page.path %}class="active"{% endif %}>
<a href="{{ page.permalink | safe }}">{{ page.title }}</a> <a href="{{ page.permalink | safe }}">{{ page.title }}</a>
</li> </li>
{% if page.toc %} {% if page.toc -%}
{% if current_path == page.path %} {% if current_path == page.path -%}
{% set_global header_count = 0 %} {% set_global header_count = 0 -%}
{% for h2 in page.toc %} {% for h2 in page.toc -%}
{% set_global header_count = header_count + 1 %} {% set_global header_count = header_count + 1 -%}
{% for h3 in h2.children %} {% for h3 in h2.children -%}
{% set_global header_count = header_count + 1 %} {% set_global header_count = header_count + 1 -%}
{% for h4 in h3.children %} {% for h4 in h3.children -%}
{% set_global header_count = header_count + 1 %} {% set_global header_count = header_count + 1 -%}
{% endfor %} {% endfor -%}
{% endfor %} {% endfor -%}
{% endfor %} {% endfor -%}
{% if header_count > 4 %} {% if header_count > 4 -%}
<ul id="toc"> <ul id="toc">
{% for h2 in page.toc %} {% for h2 in page.toc -%}
<li><a href="{{ h2.permalink | safe }}">{{ h2.title }}</a> <li><a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
{% if h2.children %} {% if h2.children -%}
<ul> <ul>
{% for h3 in h2.children %} {% for h3 in h2.children -%}
<li> <li>
<a href="{{ h3.permalink | safe }}">{{ h3.title }}</a> <a href="{{ h3.permalink | safe }}">{{ h3.title }}</a>
</li> </li>
{% endfor %} {% endfor -%}
</ul> </ul>
{% endif %} {% endif -%}
</li> </li>
{% endfor %} {% endfor -%}
</ul> </ul>
{% endif %} {% endif -%}
{% endif %} {% endif -%}
{% endif %} {% endif -%}
{% endfor %} {% endfor -%}
</ul> </ul>
{% endfor %} {% endfor -%}
</div> </div>
</nav> </nav>
{% endblock nav %} {% endblock nav -%}
<article> <article>
{% if config.build_search_index %} {% if config.build_search_index -%}
<div id="on_right"> <div id="on_right">
<span id="search-ico" class="ms-Icon--Search"></span> <span id="search-ico" class="ms-Icon--Search"></span>
</div> </div>
@ -126,10 +127,10 @@
<ul class="search-results__items"></ul> <ul class="search-results__items"></ul>
</div> </div>
</div> </div>
{% endif %} {% endif -%}
<div id="wrap"> <div id="wrap">
{% block content %} {% block content -%}
{{ section.content | safe }} {{ section.content | safe }}
{% endblock content %} {% endblock content %}
</div> </div>
@ -141,7 +142,7 @@
<script type="text/javascript" src="{{ get_url(path="elasticlunr.min.js") | safe }}" defer></script> <script type="text/javascript" src="{{ get_url(path="elasticlunr.min.js") | safe }}" defer></script>
<script type="text/javascript" src="{{ get_url(path="search_index.en.js") | safe }}" defer></script> <script type="text/javascript" src="{{ get_url(path="search_index.en.js") | safe }}" defer></script>
<script type="text/javascript" src="{{ get_url(path="js.js") | safe }}" defer></script> <script type="text/javascript" src="{{ get_url(path="js.js") | safe }}" defer></script>
{% endif %} {% endif -%}
</body> </body>
</html> </html>

View file

@ -2,21 +2,20 @@
{% block title %} {{ config.title }} | {{ section.title }} {% endblock title %} {% block title %} {{ config.title }} | {{ section.title }} {% endblock title %}
{% block content %} {% block content %}
{% if section.word_count > 0 %} {% if section.word_count > 0 -%}
{{ section.content }} {{ section.content }}
{% else %} {% else -%}
<h1 class="title"> <h1 class="title">
{{ section.title }} {{ section.title }}
</h1> </h1>
Pages: Pages:
<ul> <ul>
{% for page in section.pages %} {% for page in section.pages -%}
<li><a href="{{ page.permalink | safe }}">{{ page.title }}</a></li> <li><a href="{{ page.permalink | safe }}">{{ page.title }}</a></li>
{% endfor %} {% endfor -%}
</ul> </ul>
{% endif %} {% endif -%}
{% endblock content %} {% endblock content %}