refactor: rationalize whitespace

This commit is contained in:
Cyril MARPAUD
2023-03-14 11:29:35 +01:00
parent 63e21f0fe0
commit 295c9151f4
5 changed files with 50 additions and 53 deletions

View File

@ -19,12 +19,13 @@
</head> </head>
<body> <body>
{% block content %}{% endblock %} {% block content %}{% endblock -%}
</body>
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script> <script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script> <script>
particlesJS.load('particles', '{{ config.base_url | safe }}/particles.json', null); particlesJS.load('particles', '{{ config.base_url | safe }}/particles.json', null);
</script> </script>
</html> </body>
</html>

View File

@ -1,15 +1,12 @@
{{ section.content | safe }} {{ section.content | safe }}
<div class="columns">
<div class="columns"> {%- for page in section.pages %}
{% for page in section.pages %} <div>
<div> <h2>{{ page.title }}</h2>
<h2>{{ page.title }}</h2> {% for icon in page.extra.icons | default(value=[]) -%}
<i class="{{ icon }} fa-3x"></i>
{% for icon in page.extra.icons | default(value=[]) %} {%- endfor %}
<i class="{{ icon }} fa-3x"></i> {{ page.content | safe }}
{% endfor %} </div>
{%- endfor %}
{{ page.content | safe }} </div>
</div>
{% endfor %}
</div>

View File

@ -1,19 +1,16 @@
{{ section.content | safe }} {{ section.content | safe -}}
{% for page in section.pages %}
{% for page in section.pages %} {% set_global link_after = not link_after | default(value=false) %}
{% set_global link_after = not link_after | default(value=false) %} <h2>{{ page.title }}</h2>
<h2>{{ page.title }}</h2> <div class="list">
<div class="list"> {%- if link_after %}
{% if link_after %} {{ page.content | safe }}
{{ page.content | safe }} {%- endif -%}
{% endif %} {% if page.extra.link %}
<a aria-label="external link" class="list_link" href="{{ page.extra.link }}" target="_blank" rel="noopener noreferrer">{{ section.extra.discover | default(value="Discover") }}</a>
{% if page.extra.link %} {%- endif -%}
<a aria-label="external link" class="list_link" href="{{ page.extra.link }}" target="_blank" rel="noopener noreferrer">{{ section.extra.discover | default(value="Discover") }}</a> {% if not link_after %}
{% endif %} {{ page.content | safe -}}
{% endif %}
{% if not link_after %} </div>
{{ page.content | safe }} {%- endfor -%}
{% endif %}
</div>
{% endfor %}

View File

@ -36,28 +36,28 @@
<p> <p>
{%- for role in section.extra.roles %} {%- for role in section.extra.roles %}
<span>{{ role }}</span><br> <span>{{ role }}</span><br>
{% endfor %} {%- endfor %}
</p> </p>
</div> </div>
{%- endif -%} {%- endif %}
{% if config.extra.links -%} {% if config.extra.links -%}
<div id="links"> <div id="links">
<p> <p>
{% for link in config.extra.links -%} {%- for link in config.extra.links %}
<a aria-label="external link" href="{{ link.url }}"><i class="{{ link.icon }} fa-2x"></i></a> <a aria-label="external link" href="{{ link.url }}"><i class="{{ link.icon }} fa-2x"></i></a>
{% endfor %} {%- endfor %}
</p> </p>
</div> </div>
{% endif %} {%- endif %}
{% if sections -%} {% if sections -%}
<div id="internal_links"> <div id="internal_links">
<p> <p>
{% for section in sections -%} {%- for section in sections %}
{% set section_name = macro::get_section_name(section=section) %} {% set section_name = macro::get_section_name(section=section) -%}
<a aria-label="go to {{ section_name }} section" href="#{{ section_name }}">{{ macro::get_section_title(section=section) }}</a> <a aria-label="go to {{ section_name }} section" href="#{{ section_name }}">{{ macro::get_section_title(section=section) }}</a>
{% endfor %} {%- endfor %}
</p> </p>
</div> </div>
{%- endif %} {%- endif %}
@ -65,8 +65,8 @@
</div> </div>
</div> </div>
{% for section in sections -%} {%- for section in sections %}
{{ macro::card(section=section) }} {{ macro::card(section=section) }}
{% endfor -%} {%- endfor %}
{% endblock content %} {% endblock content %}

View File

@ -1,6 +1,7 @@
{% macro card(section) -%} {% macro card(section) -%}
{% set section_name = macro::get_section_name(section=section) -%} {% set section_name = macro::get_section_name(section=section) %}
<div id="{{ section_name }}" class="fullflex"> <div id="{{ section_name }}" class="fullflex">
<div class="arrows"> <div class="arrows">
<div class="down"> <div class="down">
<a aria-label="Go to {{ section_name }} section" href="#{{ section_name }}"><i class="fa-solid fa-chevron-down fa-2x"></i></a> <a aria-label="Go to {{ section_name }} section" href="#{{ section_name }}"><i class="fa-solid fa-chevron-down fa-2x"></i></a>
@ -9,21 +10,22 @@
<a aria-label="Go to landing section" href="#landing"><i class="fa-solid fa-chevron-up fa-2x"></i></a> <a aria-label="Go to landing section" href="#landing"><i class="fa-solid fa-chevron-up fa-2x"></i></a>
</div> </div>
</div> </div>
<div class="card"> <div class="card">
<h1>{{ macro::get_section_title(section=section) }}</h1> <h1>{{ macro::get_section_title(section=section) }}</h1>
{% set card_type = section.extra.card_type | default(value="simple") %} {% set card_type = section.extra.card_type | default(value="simple") -%}
{% if card_type == "simple" -%} {% if card_type == "simple" -%}
{%- include "cards/simple.html" -%} {% include "cards/simple.html" -%}
{% elif card_type == "columns" -%} {% elif card_type == "columns" -%}
{%- include "cards/columns.html" -%} {% include "cards/columns.html" -%}
{% elif card_type == "list" -%} {% elif card_type == "list" -%}
{%- include "cards/list.html" -%} {% include "cards/list.html" -%}
{% else -%} {% else -%}
<p>Unknown Card Type 🤷</p> <p>Unknown Card Type 🤷</p>
{% endif -%} {%- endif %}
</div> </div>
</div> </div>
{% endmacro %} {%- endmacro %}