Autoformatted some twigs

This commit is contained in:
pikim 2023-01-19 23:36:48 +01:00
parent 05a45ecb94
commit 3fe6574d0b
5 changed files with 149 additions and 144 deletions

View file

@ -1,7 +1,9 @@
{% extends 'partials/base.html.twig' %} {% extends 'partials/base.html.twig' %}
{% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %} {% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %}
{% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %} {% macro pageLinkName(text) %}
{{ text|lower|replace({' ':'_'}) }}
{% endmacro %}
{% block menu %} {% block menu %}
{% include 'partials/sidebar_right.html.twig' %} {% include 'partials/sidebar_right.html.twig' %}
@ -32,5 +34,3 @@
{% include 'partials/sidebar_left.html.twig' %} {% include 'partials/sidebar_left.html.twig' %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View file

@ -2,24 +2,24 @@
{% set miniposts_number = config.theme.miniposts_number %} {% set miniposts_number = config.theme.miniposts_number %}
<section> <section>
<header class=""> <header class="">
<h3>{{ 'FUTURE.FEATURED'|t }}</h3> <h3>{{ 'FUTURE.FEATURED'|t }}</h3>
</header> </header>
<div class="mini-posts"> <div class="mini-posts">
{% for p in page.evaluate({'@taxonomy.category':miniposts_category}).order('header.order', 'asc').slice(0,miniposts_number) %} {% for p in page.evaluate({'@taxonomy.category':miniposts_category}).order('header.order', 'asc').slice(0,miniposts_number) %}
<article class="mini-post"> <article class="mini-post">
<header> <header>
<h3><a href="{{ p.url }}">{{ p.title }}</a></h3> <h3>
<a href="{{ p.url }}">{{ p.title }}</a>
</h3>
{% if plugin.translate_date.enabled %} {% if plugin.translate_date.enabled %}
<time class="published" datetime="{{ p.date|td(null, "Y-m-d") }}">{{ p.date|td }}</time> <time class="published" datetime="{{ p.date|td(null, "Y-m-d") }}">{{ p.date|td }}</time>
{% else %} {% else %}
<time class="published" datetime="{{ p.date|date("Y-m-d") }}">{{ p.date|date("M j, Y") }}</time> <time class="published" datetime="{{ p.date|date("Y-m-d") }}">{{ p.date|date("M j, Y") }}</time>
{% endif %} {% endif %}
<a href="{{ p.url }}" class="author"><img src="{{ p.media[p.header.avatarImage].url}}" alt="" /></a> <a href="{{ p.url }}" class="author"><img src="{{ p.media[p.header.avatarImage].url}}" alt=""/></a>
</header> </header>
<a href="{{ p.url }}" class="image"> <a href="{{ p.url }}" class="image">
{% if p.header.primaryImage %} {% if p.header.primaryImage %}
{{ p.media[p.header.primaryImage].cropZoom(1038,437).loading('lazy').html('',p.title)|raw}} {{ p.media[p.header.primaryImage].cropZoom(1038,437).loading('lazy').html('',p.title)|raw}}
{% else %} {% else %}
@ -27,9 +27,7 @@
{% endif %} {% endif %}
</a> </a>
</article> </article>
{% endfor %} {% endfor %}
</div> </div>
</section> </section>
<!-- End of featured Section --> <!-- End of featured Section -->

View file

@ -5,8 +5,13 @@
{% if p.children.visible.count > 0 %} {% if p.children.visible.count > 0 %}
<li class="{{ current_page }}"> <li class="{{ current_page }}">
<a class="dropdown-btn"> <a class="dropdown-btn">
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %} {% if p.header.icon %}
<span>{{ p.menu }}{% if p.routable ?? false %}&nbsp;<i class="fa fa-caret-down"></i>{% endif %}</span> <i class="fa fa-{{ p.header.icon }}"></i>
{% endif %}
<span>{{ p.menu }}
{% if p.routable ?? false %}&nbsp;<i class="fa fa-caret-down"></i>
{% endif %}
</span>
</a> </a>
<ul class="subitem_hide"> <ul class="subitem_hide">
{{ _self.loop(p) }} {{ _self.loop(p) }}
@ -15,7 +20,9 @@
{% else %} {% else %}
<li class="{{ current_page }}"> <li class="{{ current_page }}">
<a href="{{ p.url }}"> <a href="{{ p.url }}">
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %} {% if p.header.icon %}
<i class="fa fa-{{ p.header.icon }}"></i>
{% endif %}
<span>{{ p.menu }}</span> <span>{{ p.menu }}</span>
</a> </a>
</li> </li>

View file

@ -43,15 +43,15 @@
{% endif %} {% endif %}
</section> </section>
<script> <script>
{% if p.routable == false and p.children.count > 0%} {% if p.routable == false and p.children.count > 0 %}
$(".subitem_hide").hide(); //this hides the list initially $(".subitem_hide").hide(); // this hides the list initially
$(".dropdown-btn").click(function(){ $(".dropdown-btn").click(function () {
$(this).next(".subitem_hide").slideToggle(); $(this).next(".subitem_hide").slideToggle();
}); });
{% else %} {% else %}
$(".subitem").attr("style", "display:block"); //this shows the list if it is routable $(".subitem").attr("style", "display:block"); // this shows the list if it is routable
$(".dropdown-btn").click(function(){ $(".dropdown-btn").click(function () {
$(this).next(".subitem_hide").slideToggle(); $(this).next(".subitem_hide").slideToggle();
}); });
{% endif %} {% endif %}
</script> </script>