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,30 +1,32 @@
{% extends 'partials/base.html.twig' %}
{% 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 %}
{% include 'partials/sidebar_right.html.twig' %}
{% endblock %}
{% block content %}
<article class="post">
<header>
<div class="title">
<h2>{{ page.header.title }}</h2>
</div>
</header>
<article class="post">
<header>
<div class="title">
<h2>{{ page.header.title }}</h2>
</div>
</header>
{% if page.header.primaryImage %}
{{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}
{% else %}
{{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}
{% endif %}
{{ page.content|raw}}
{% for module in page.collection() %}
{{ module.content|raw }}
{% endfor %}
</article>
{% if page.header.primaryImage %}
{{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}
{% else %}
{{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}
{% endif %}
{{ page.content|raw}}
{% for module in page.collection() %}
{{ module.content|raw }}
{% endfor %}
</article>
{% endblock %}
{% block sidebar %}
@ -32,5 +34,3 @@
{% include 'partials/sidebar_left.html.twig' %}
{% endif %}
{% endblock %}

View file

@ -2,34 +2,32 @@
{% set miniposts_number = config.theme.miniposts_number %}
<section>
<header class="">
<header class="">
<h3>{{ 'FUTURE.FEATURED'|t }}</h3>
</header>
<div class="mini-posts">
</header>
<div class="mini-posts">
{% 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>
<h3><a href="{{ p.url }}">{{ p.title }}</a></h3>
{% if plugin.translate_date.enabled %}
<h3>
<a href="{{ p.url }}">{{ p.title }}</a>
</h3>
{% if plugin.translate_date.enabled %}
<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>
{% endif %}
<a href="{{ p.url }}" class="author"><img src="{{ p.media[p.header.avatarImage].url}}" alt="" /></a>
{% endif %}
<a href="{{ p.url }}" class="author"><img src="{{ p.media[p.header.avatarImage].url}}" alt=""/></a>
</header>
<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}}
{% else %}
{% else %}
{{p.media.images|first.cropZoom(1038,437).loading('lazy').html('',p.title)|raw}}
{% endif %}
{% endif %}
</a>
</article>
</article>
{% endfor %}
</div>
</div>
</section>
<!-- End of featured Section -->

View file

@ -9,24 +9,24 @@
</section>
<!-- Mini Posts -->
{% if theme_config.miniposts == true %}
{% block miniposts %}
{% include 'partials/miniposts.html.twig' %}
{% block miniposts %}
{% include 'partials/miniposts.html.twig' %}
{% endblock %}
{% endif %}
<!-- About -->
{% if theme_config.footer.title or theme_config.footer.description %}
<section class="blurb">
<h2>{{theme_config.footer.title}}</h2>
<p>{{theme_config.footer.description}}</p>
<ul class="actions">
<li><a href="{{theme_config.footer.button_url}}" class="button">{{theme_config.footer.button_text}}</a></li>
</ul>
</section>
<section class="blurb">
<h2>{{theme_config.footer.title}}</h2>
<p>{{theme_config.footer.description}}</p>
<ul class="actions">
<li><a href="{{theme_config.footer.button_url}}" class="button">{{theme_config.footer.button_text}}</a></li>
</ul>
</section>
{% endif %}
<!-- Footer -->
<section id="footer">
{% block footer %}
{% include 'partials/footer.html.twig' %}
{% endblock %}
</section>
</section>
{% block footer %}
{% include 'partials/footer.html.twig' %}
{% endblock %}
</section>
</section>

View file

@ -1,40 +1,47 @@
{% block menu_navigation %}
{% macro loop(page) %}
{% for p in page.children.visible %}
{% set current_page = (p.active or p.activeChild) ? 'active' : '' %}
{% if p.children.visible.count > 0 %}
<li class="{{ current_page }}">
<a class="dropdown-btn">
{% if p.header.icon %}<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>
<ul class="subitem_hide">
{{ _self.loop(p) }}
</ul>
</li>
{% else %}
<li class="{{ current_page }}">
<a href="{{ p.url }}">
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
<span>{{ p.menu }}</span>
</a>
</li>
{% endif %}
{% endfor %}
{% endmacro %}
<ul class="menulink">
{{ _self.loop(pages) }}
{% if theme_var('custommenus.enabled') %}
{% for mitem in theme_var('custommenu') %}
<li>
<a href="{{ mitem.url }}" target="{{ mitem.target }}">
{% if mitem.icon %}
<i class="fa fa-{{ mitem.icon }}"></i>
{% endif %}
<span>{{ mitem.text }}</span>
</a>
</li>
{% endfor %}
{% endif %}
</ul>
{% endblock %}
{% block menu_navigation %}
{% macro loop(page) %}
{% for p in page.children.visible %}
{% set current_page = (p.active or p.activeChild) ? 'active' : '' %}
{% if p.children.visible.count > 0 %}
<li class="{{ current_page }}">
<a class="dropdown-btn">
{% if p.header.icon %}
<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>
<ul class="subitem_hide">
{{ _self.loop(p) }}
</ul>
</li>
{% else %}
<li class="{{ current_page }}">
<a href="{{ p.url }}">
{% if p.header.icon %}
<i class="fa fa-{{ p.header.icon }}"></i>
{% endif %}
<span>{{ p.menu }}</span>
</a>
</li>
{% endif %}
{% endfor %}
{% endmacro %}
<ul class="menulink">
{{ _self.loop(pages) }}
{% if theme_var('custommenus.enabled') %}
{% for mitem in theme_var('custommenu') %}
<li>
<a href="{{ mitem.url }}" target="{{ mitem.target }}">
{% if mitem.icon %}
<i class="fa fa-{{ mitem.icon }}"></i>
{% endif %}
<span>{{ mitem.text }}</span>
</a>
</li>
{% endfor %}
{% endif %}
</ul>
{% endblock %}

View file

@ -1,57 +1,57 @@
<section id="menu">
{% if config.plugins.simplesearch.enabled %}
<!-- Search -->
<section>
{% include 'partials/simplesearch_searchbox_sidebar.html.twig' %}
</section>
{% endif %}
<!-- Links -->
<section id="sidebarmenu">
{% include 'partials/sidebar_navigation.html.twig' %}
</section>
{% if config.plugins.archives.enabled %}
<!-- Actions -->
<section>
<header>
<h3>{{ 'FUTURE.SIDEBAR.ARCHIVES.HEADLINE'|t }}</h3>
</header>
{% include 'partials/archives.html.twig' %}
</section>
{% endif %}
{% if config.plugins.relatedpages.enabled %}
<section>
<header>
<h3>{{ 'FUTURE.SIDEBAR.RELATED_POSTS.HEADLINE'|t }}</h3>
</header>
{% include 'partials/relatedpages.html.twig' %}
</section>
{% endif %}
{% if config.plugins.taxonomylist.enabled %}
<section>
<header>
<h3>{{ 'FUTURE.SIDEBAR.TAGS.HEADLINE'|t }}</h3>
</header>
{% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
</section>
{% endif %}
{% if config.plugins.login.enabled %}
<section>
<ul class="actions stacked">
<li><a href="#" class="button large fit">{{ 'FUTURE.LOGIN'|t }}</a></li>
</ul>
</section>
{% endif %}
{% if config.plugins.simplesearch.enabled %}
<!-- Search -->
<section>
{% include 'partials/simplesearch_searchbox_sidebar.html.twig' %}
</section>
{% endif %}
<!-- Links -->
<section id="sidebarmenu">
{% include 'partials/sidebar_navigation.html.twig' %}
</section>
{% if config.plugins.archives.enabled %}
<!-- Actions -->
<section>
<header>
<h3>{{ 'FUTURE.SIDEBAR.ARCHIVES.HEADLINE'|t }}</h3>
</header>
{% include 'partials/archives.html.twig' %}
</section>
{% endif %}
{% if config.plugins.relatedpages.enabled %}
<section>
<header>
<h3>{{ 'FUTURE.SIDEBAR.RELATED_POSTS.HEADLINE'|t }}</h3>
</header>
{% include 'partials/relatedpages.html.twig' %}
</section>
{% endif %}
{% if config.plugins.taxonomylist.enabled %}
<section>
<header>
<h3>{{ 'FUTURE.SIDEBAR.TAGS.HEADLINE'|t }}</h3>
</header>
{% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
</section>
{% endif %}
{% if config.plugins.login.enabled %}
<section>
<ul class="actions stacked">
<li><a href="#" class="button large fit">{{ 'FUTURE.LOGIN'|t }}</a></li>
</ul>
</section>
{% endif %}
</section>
<script>
{% if p.routable == false and p.children.count > 0%}
$(".subitem_hide").hide(); //this hides the list initially
$(".dropdown-btn").click(function(){
$(this).next(".subitem_hide").slideToggle();
});
{% else %}
$(".subitem").attr("style", "display:block"); //this shows the list if it is routable
$(".dropdown-btn").click(function(){
$(this).next(".subitem_hide").slideToggle();
});
{% endif %}
{% if p.routable == false and p.children.count > 0 %}
$(".subitem_hide").hide(); // this hides the list initially
$(".dropdown-btn").click(function () {
$(this).next(".subitem_hide").slideToggle();
});
{% else %}
$(".subitem").attr("style", "display:block"); // this shows the list if it is routable
$(".dropdown-btn").click(function () {
$(this).next(".subitem_hide").slideToggle();
});
{% endif %}
</script>