mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-06-07 20:08:54 +00:00
71 lines
2.3 KiB
Twig
Executable file
71 lines
2.3 KiB
Twig
Executable file
{% extends 'partials/base.html.twig' %}
|
|
|
|
{% set collection = page.collection() %}
|
|
{% set base_url = page.url %}
|
|
{% set feed_url = base_url %}
|
|
{% set show_breadcrumbs = header_var('show_breadcrumbs')|defined(true) %}
|
|
{% set show_pagination = header_var('show_pagination')|defined(true) %}
|
|
|
|
{# Set page title by taxonomy #}
|
|
{% if uri.param('category') %}
|
|
{% set listing_title = 'FUTURE.BLOG.LISTING_TITLE_CATEGORY'|t ~ uri.param('category') %}
|
|
{% elseif uri.param('tag') %}
|
|
{% set listing_title = 'FUTURE.BLOG.LISTING_TITLE_TAG'|t ~ uri.param('tag') %}
|
|
{% elseif uri.param('author') %}
|
|
{% set listing_title = 'FUTURE.BLOG.LISTING_TITLE_AUTHOR'|t ~ uri.param('author') %}
|
|
{% else %}
|
|
{% set listing_title = page.header.subtitle|raw %}
|
|
{% endif %}
|
|
|
|
{% if base_url == '/' %}
|
|
{% set base_url = '' %}
|
|
{% endif %}
|
|
|
|
{% if base_url == base_url_relative %}
|
|
{% set feed_url = base_url~'/'~page.slug %}
|
|
{% endif %}
|
|
|
|
{% block menu %}
|
|
{% include 'partials/sidebar_right.html.twig' %}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<article class="heading">
|
|
{% if image %}
|
|
<span class="image featured">
|
|
{{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title)|raw }}
|
|
</span>
|
|
{% endif %}
|
|
<div class="title">
|
|
<h1 itemprop="headline">{{ title }}</h1>
|
|
{% if listing_title %}
|
|
<p>{{ listing_title|raw }}</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{{ page.content|raw }}
|
|
|
|
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
|
|
{% include 'partials/breadcrumbs.html.twig' %}
|
|
{% endif %}
|
|
</article>
|
|
{% for child in collection %}
|
|
{% include 'partials/blog_item.html.twig' with {'page':child, 'title': child.title|raw, 'subtitle': child.header.subtitle|raw, 'listing': true, 'truncate':true} %}
|
|
{% endfor %}
|
|
|
|
{% if show_pagination and config.plugins.pagination.enabled and collection.params.pagination %}
|
|
{% include 'partials/pagination.html.twig' with {base_url: page.url, pagination: collection.params.pagination} %}
|
|
{% endif %}
|
|
|
|
{% if show_sidebar == false %}
|
|
<section id="footer" class="align-center">
|
|
{% include 'partials/footer.html.twig' %}
|
|
</section>
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block sidebar %}
|
|
{% if show_sidebar == true %}
|
|
{% include 'partials/sidebar_left.html.twig' %}
|
|
{% endif %}
|
|
{% endblock %}
|