grav/themes/quark-open-publishing/templates/blog.html.twig

119 lines
5.2 KiB
Twig
Raw Normal View History

{% extends 'partials/base.html.twig' %}
{% set blog_image = page.media.images[page.header.hero_image] ?: page.media.images|first %}
{% set collection = page.collection() %}
{# revise checks for Blog list page options - hibbittsdesign.org #}
{% if page.header.show_breadcrumbs is defined %}
{% set show_breadcrumbs = page.header.show_breadcrumbs %}
{% else %}
{% set show_breadcrumbs = true %}
{% endif %}
{% if page.header.show_sidebar is defined %}
{% set show_sidebar = page.header.show_sidebar %}
{% else %}
{% set show_sidebar = true %}
{% endif %}
{% if page.header.show_pagination is defined %}
{% set show_pagination = page.header.show_pagination %}
{% else %}
{% set show_pagination = true %}
{% endif %}
{% block stylesheets %}
{% do assets.addCss('theme://css/bricklayer.css') %}
{{ parent() }}
{% endblock %}
{% block javascripts %}
{{ parent() }}
{% do assets.add('theme://js/bricklayer.min.js') %}
{% endblock %}
{# check content display flag - hibbittsdesign.org #}
{% if not (grav.uri.param('chromeless') or grav.uri.param('embedded') or grav.uri.param('standalone')) and not(theme_var('chromeless.enabled')) %}
{% block hero %}
{% include 'partials/hero.html.twig' with {id: 'blog-hero', content: page.content, hero_image: blog_image} %}
{% endblock %}
{% endif %}
{% block body %}
<section id="body-wrapper" class="section blog-listing">
<section class="container {{ grid_size }}">
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
{% include 'partials/breadcrumbs.html.twig' %}
{% endif %}
{% embed 'partials/layout.html.twig' with {blog: page} %}
{% block item %}
{# Added support for modular page content - hibbittsdesign.org #}
{% if ((page.header.bricklayer_layout is not defined) or (page.header.bricklayer_layout)) %}
<div class="bricklayermodulars">
{% else %}
<div>
{% endif %}
{% if page.collection('modular_content') is not empty %}
{% for module in page.collection('modular_content') %}
{% if (module.content|striptags)|trim %}
<p>{{ module.content|raw }}</p>
{% endif %}
{% endfor %}
{% endif %}
</div>
{% if ((page.header.bricklayer_layout is not defined) or (page.header.bricklayer_layout)) %}
<div class="bricklayer">
{% else %}
<div>
{% endif %}
{# display posts with 'featured' tag on current blog page - hibbittsdesign.org #}
{% for child in taxonomy.findTaxonomy({'tag': "featured"}) %}
{% include 'partials/blog-list-item.html.twig' with {blog: page, page: child} %}
{% endfor %}
{# display posts without 'featured' tag - hibbittsdesign.org #}
{% for child in collection %}
{% if "featured" not in child.taxonomy['tag'] %}
{% include 'partials/blog-list-item.html.twig' with {blog: page, page: child} %}
{% endif %}
{% endfor %}
</div>
{% if show_pagination and config.plugins.pagination.enabled and collection.params.pagination %}
<div id="listing-footer">
{% include 'partials/pagination.html.twig' with {base_url: page.url, pagination: collection.params.pagination} %}
</div>
{% endif %}
<div style="text-align:center;">
{# check to display CC License - hibbittsdesign.org #} {# check to display git sync link in page - hibbittsdesign.org #}
{% if theme_var('display_of_git_sync_repo_link') == 'page' and not (grav.uri.param('summaryonly') or grav.uri.param('onlysummary')) %}
<p>{% include 'partials/git_sync_repo_link_note.html.twig' %}</p>
{% endif %}
{% if not (grav.uri.param('chromeless') or grav.uri.param('embedded') or grav.uri.param('standalone')) and not(theme_var('chromeless.enabled')) and (theme_var('cc_license.enabled') and not(page.header.hide_cc_license) and not (grav.uri.param('onlysummary'))) %}
<p>{% include 'partials/creative_commons_license.html.twig' %}</p>
{% endif %}
</div>
{% endblock %}
{# check content display flag - hibbittsdesign.org #}
{% if not (grav.uri.param('chromeless') or grav.uri.param('embedded') or grav.uri.param('standalone')) and not(theme_var('chromeless.enabled')) %}
{% block sidebar %}
{% include 'partials/sidebar.html.twig' %}
{% endblock %}
{% endif %}
{% endembed %}
</section>
</section>
<script>
//Bricklayer
{% if ((page.header.bricklayer_layout is not defined) or (page.header.bricklayer_layout)) %}
var bricklayer = new Bricklayer(document.querySelector('.bricklayer'))
{% endif %}
</script>
{% endblock %}