mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-06-29 06:38:54 +00:00
Autoformatted some twigs
This commit is contained in:
parent
05a45ecb94
commit
3fe6574d0b
5 changed files with 149 additions and 144 deletions
|
@ -1,30 +1,32 @@
|
||||||
{% 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' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<article class="post">
|
<article class="post">
|
||||||
<header>
|
<header>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<h2>{{ page.header.title }}</h2>
|
<h2>{{ page.header.title }}</h2>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{% if page.header.primaryImage %}
|
{% if page.header.primaryImage %}
|
||||||
{{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}
|
{{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}
|
{{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ page.content|raw}}
|
{{ page.content|raw}}
|
||||||
{% for module in page.collection() %}
|
{% for module in page.collection() %}
|
||||||
{{ module.content|raw }}
|
{{ module.content|raw }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</article>
|
</article>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
|
@ -32,5 +34,3 @@
|
||||||
{% include 'partials/sidebar_left.html.twig' %}
|
{% include 'partials/sidebar_left.html.twig' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,34 +2,32 @@
|
||||||
{% 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>
|
||||||
{% if plugin.translate_date.enabled %}
|
<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>
|
<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 %}
|
||||||
{{p.media.images|first.cropZoom(1038,437).loading('lazy').html('',p.title)|raw}}
|
{{p.media.images|first.cropZoom(1038,437).loading('lazy').html('',p.title)|raw}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<!-- End of featured Section -->
|
<!-- End of featured Section -->
|
||||||
|
|
||||||
|
|
|
@ -9,24 +9,24 @@
|
||||||
</section>
|
</section>
|
||||||
<!-- Mini Posts -->
|
<!-- Mini Posts -->
|
||||||
{% if theme_config.miniposts == true %}
|
{% if theme_config.miniposts == true %}
|
||||||
{% block miniposts %}
|
{% block miniposts %}
|
||||||
{% include 'partials/miniposts.html.twig' %}
|
{% include 'partials/miniposts.html.twig' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<!-- About -->
|
<!-- About -->
|
||||||
{% if theme_config.footer.title or theme_config.footer.description %}
|
{% if theme_config.footer.title or theme_config.footer.description %}
|
||||||
<section class="blurb">
|
<section class="blurb">
|
||||||
<h2>{{theme_config.footer.title}}</h2>
|
<h2>{{theme_config.footer.title}}</h2>
|
||||||
<p>{{theme_config.footer.description}}</p>
|
<p>{{theme_config.footer.description}}</p>
|
||||||
<ul class="actions">
|
<ul class="actions">
|
||||||
<li><a href="{{theme_config.footer.button_url}}" class="button">{{theme_config.footer.button_text}}</a></li>
|
<li><a href="{{theme_config.footer.button_url}}" class="button">{{theme_config.footer.button_text}}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<section id="footer">
|
<section id="footer">
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
{% include 'partials/footer.html.twig' %}
|
{% include 'partials/footer.html.twig' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -1,40 +1,47 @@
|
||||||
{% block menu_navigation %}
|
{% block menu_navigation %}
|
||||||
{% macro loop(page) %}
|
{% macro loop(page) %}
|
||||||
{% for p in page.children.visible %}
|
{% for p in page.children.visible %}
|
||||||
{% set current_page = (p.active or p.activeChild) ? 'active' : '' %}
|
{% set current_page = (p.active or p.activeChild) ? 'active' : '' %}
|
||||||
{% 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 %} <i class="fa fa-caret-down"></i>{% endif %}</span>
|
<i class="fa fa-{{ p.header.icon }}"></i>
|
||||||
</a>
|
{% endif %}
|
||||||
<ul class="subitem_hide">
|
<span>{{ p.menu }}
|
||||||
{{ _self.loop(p) }}
|
{% if p.routable ?? false %} <i class="fa fa-caret-down"></i>
|
||||||
</ul>
|
{% endif %}
|
||||||
</li>
|
</span>
|
||||||
{% else %}
|
</a>
|
||||||
<li class="{{ current_page }}">
|
<ul class="subitem_hide">
|
||||||
<a href="{{ p.url }}">
|
{{ _self.loop(p) }}
|
||||||
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
|
</ul>
|
||||||
<span>{{ p.menu }}</span>
|
</li>
|
||||||
</a>
|
{% else %}
|
||||||
</li>
|
<li class="{{ current_page }}">
|
||||||
{% endif %}
|
<a href="{{ p.url }}">
|
||||||
{% endfor %}
|
{% if p.header.icon %}
|
||||||
{% endmacro %}
|
<i class="fa fa-{{ p.header.icon }}"></i>
|
||||||
<ul class="menulink">
|
{% endif %}
|
||||||
{{ _self.loop(pages) }}
|
<span>{{ p.menu }}</span>
|
||||||
{% if theme_var('custommenus.enabled') %}
|
</a>
|
||||||
{% for mitem in theme_var('custommenu') %}
|
</li>
|
||||||
<li>
|
{% endif %}
|
||||||
<a href="{{ mitem.url }}" target="{{ mitem.target }}">
|
{% endfor %}
|
||||||
{% if mitem.icon %}
|
{% endmacro %}
|
||||||
<i class="fa fa-{{ mitem.icon }}"></i>
|
<ul class="menulink">
|
||||||
{% endif %}
|
{{ _self.loop(pages) }}
|
||||||
<span>{{ mitem.text }}</span>
|
{% if theme_var('custommenus.enabled') %}
|
||||||
</a>
|
{% for mitem in theme_var('custommenu') %}
|
||||||
</li>
|
<li>
|
||||||
{% endfor %}
|
<a href="{{ mitem.url }}" target="{{ mitem.target }}">
|
||||||
{% endif %}
|
{% if mitem.icon %}
|
||||||
</ul>
|
<i class="fa fa-{{ mitem.icon }}"></i>
|
||||||
{% endblock %}
|
{% endif %}
|
||||||
|
<span>{{ mitem.text }}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
|
|
|
@ -1,57 +1,57 @@
|
||||||
<section id="menu">
|
<section id="menu">
|
||||||
{% if config.plugins.simplesearch.enabled %}
|
{% if config.plugins.simplesearch.enabled %}
|
||||||
<!-- Search -->
|
<!-- Search -->
|
||||||
<section>
|
<section>
|
||||||
{% include 'partials/simplesearch_searchbox_sidebar.html.twig' %}
|
{% include 'partials/simplesearch_searchbox_sidebar.html.twig' %}
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<!-- Links -->
|
<!-- Links -->
|
||||||
<section id="sidebarmenu">
|
<section id="sidebarmenu">
|
||||||
{% include 'partials/sidebar_navigation.html.twig' %}
|
{% include 'partials/sidebar_navigation.html.twig' %}
|
||||||
</section>
|
</section>
|
||||||
{% if config.plugins.archives.enabled %}
|
{% if config.plugins.archives.enabled %}
|
||||||
<!-- Actions -->
|
<!-- Actions -->
|
||||||
<section>
|
<section>
|
||||||
<header>
|
<header>
|
||||||
<h3>{{ 'FUTURE.SIDEBAR.ARCHIVES.HEADLINE'|t }}</h3>
|
<h3>{{ 'FUTURE.SIDEBAR.ARCHIVES.HEADLINE'|t }}</h3>
|
||||||
</header>
|
</header>
|
||||||
{% include 'partials/archives.html.twig' %}
|
{% include 'partials/archives.html.twig' %}
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if config.plugins.relatedpages.enabled %}
|
{% if config.plugins.relatedpages.enabled %}
|
||||||
<section>
|
<section>
|
||||||
<header>
|
<header>
|
||||||
<h3>{{ 'FUTURE.SIDEBAR.RELATED_POSTS.HEADLINE'|t }}</h3>
|
<h3>{{ 'FUTURE.SIDEBAR.RELATED_POSTS.HEADLINE'|t }}</h3>
|
||||||
</header>
|
</header>
|
||||||
{% include 'partials/relatedpages.html.twig' %}
|
{% include 'partials/relatedpages.html.twig' %}
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if config.plugins.taxonomylist.enabled %}
|
{% if config.plugins.taxonomylist.enabled %}
|
||||||
<section>
|
<section>
|
||||||
<header>
|
<header>
|
||||||
<h3>{{ 'FUTURE.SIDEBAR.TAGS.HEADLINE'|t }}</h3>
|
<h3>{{ 'FUTURE.SIDEBAR.TAGS.HEADLINE'|t }}</h3>
|
||||||
</header>
|
</header>
|
||||||
{% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
|
{% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if config.plugins.login.enabled %}
|
{% if config.plugins.login.enabled %}
|
||||||
<section>
|
<section>
|
||||||
<ul class="actions stacked">
|
<ul class="actions stacked">
|
||||||
<li><a href="#" class="button large fit">{{ 'FUTURE.LOGIN'|t }}</a></li>
|
<li><a href="#" class="button large fit">{{ 'FUTURE.LOGIN'|t }}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
{% 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>
|
||||||
|
|
Loading…
Add table
Reference in a new issue