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>
<body>
{% block content %}{% endblock %}
</body>
{% block content %}{% endblock -%}
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script>
particlesJS.load('particles', '{{ config.base_url | safe }}/particles.json', null);
</script>
</html>
</body>
</html>

View File

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

View File

@ -1,19 +1,16 @@
{{ section.content | safe }}
{% for page in section.pages %}
{% set_global link_after = not link_after | default(value=false) %}
<h2>{{ page.title }}</h2>
<div class="list">
{% if link_after %}
{{ page.content | safe }}
{% 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>
{% endif %}
{% if not link_after %}
{{ page.content | safe }}
{% endif %}
</div>
{% endfor %}
{{ section.content | safe -}}
{% for page in section.pages %}
{% set_global link_after = not link_after | default(value=false) %}
<h2>{{ page.title }}</h2>
<div class="list">
{%- if link_after %}
{{ page.content | safe }}
{%- 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>
{%- endif -%}
{% if not link_after %}
{{ page.content | safe -}}
{% endif %}
</div>
{%- endfor -%}

View File

@ -36,28 +36,28 @@
<p>
{%- for role in section.extra.roles %}
<span>{{ role }}</span><br>
{% endfor %}
{%- endfor %}
</p>
</div>
{%- endif -%}
{%- endif %}
{% if config.extra.links -%}
<div id="links">
<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>
{% endfor %}
{%- endfor %}
</p>
</div>
{% endif %}
{%- endif %}
{% if sections -%}
<div id="internal_links">
<p>
{% for section in sections -%}
{% set section_name = macro::get_section_name(section=section) %}
{%- for section in sections %}
{% 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>
{% endfor %}
{%- endfor %}
</p>
</div>
{%- endif %}
@ -65,8 +65,8 @@
</div>
</div>
{% for section in sections -%}
{%- for section in sections %}
{{ macro::card(section=section) }}
{% endfor -%}
{%- endfor %}
{% endblock content %}

View File

@ -1,6 +1,7 @@
{% 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 class="arrows">
<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>
@ -9,21 +10,22 @@
<a aria-label="Go to landing section" href="#landing"><i class="fa-solid fa-chevron-up fa-2x"></i></a>
</div>
</div>
<div class="card">
<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" -%}
{%- include "cards/simple.html" -%}
{% include "cards/simple.html" -%}
{% elif card_type == "columns" -%}
{%- include "cards/columns.html" -%}
{% include "cards/columns.html" -%}
{% elif card_type == "list" -%}
{%- include "cards/list.html" -%}
{% include "cards/list.html" -%}
{% else -%}
<p>Unknown Card Type 🤷</p>
{% endif -%}
{%- endif %}
</div>
</div>
{% endmacro %}
{%- endmacro %}