mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-06-07 20:08:54 +00:00
Updated blog template
Modification to show the featured image of the blog page, the title and subtitle if they exist.
This commit is contained in:
parent
98b7d8400f
commit
c89a3b76cd
1 changed files with 25 additions and 8 deletions
|
@ -13,15 +13,18 @@
|
|||
{% else %}
|
||||
{% set show_pagination = true %}
|
||||
{% endif %}
|
||||
{% set image = page.media[page.header.primaryImage] %}
|
||||
{% set title = page.title|raw %}
|
||||
|
||||
{# Set page title by taxonomy #}
|
||||
{% if uri.param('category') %}
|
||||
{% set page_title = theme_config.listing_title.taxonomy.category | default('Posts in Category: ') ~ uri.param('category') %}
|
||||
{% set listing_title = 'FUTURE.BLOG.LISTING_TITLE_CATEGORY'|t ~ uri.param('category') %}
|
||||
{% elseif uri.param('tag') %}
|
||||
{% set page_title = theme_config.listing_title.taxonomy.tag | default('Posts with Tag: ') ~ uri.param('tag') %}
|
||||
{% set listing_title = 'FUTURE.BLOG.LISTING_TITLE_TAG'|t ~ uri.param('tag') %}
|
||||
{% elseif uri.param('author') %}
|
||||
{% set page_title = theme_config.listing_title.taxonomy.author | default('Posts from Author: ') ~ uri.param('author') %}
|
||||
{% set listing_title = 'FUTURE.BLOG.LISTING_TITLE_AUTHOR'|t ~ uri.param('author') %}
|
||||
{% else %}
|
||||
{% set page_title = theme_config.listing_title.blog | default('') %}
|
||||
{% set listing_title = page.header.subtitle|raw %}
|
||||
{% endif %}
|
||||
|
||||
{% if base_url == '/' %}
|
||||
|
@ -37,14 +40,28 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<header>
|
||||
<div class="title">
|
||||
<h2>{{ title }}</h2>
|
||||
{% if listing_title %}
|
||||
<p>{{ listing_title|raw }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% if image %}
|
||||
{{ image.cropZoom(1038,437).loading('lazy').html(title, title, 'image featured')|raw }}
|
||||
{% else %}
|
||||
{{ image|first.cropZoom(1038,437).loading('lazy').html(title,title, 'image featured')|raw }}
|
||||
{% endif %}
|
||||
|
||||
{{ page.content|raw }}
|
||||
|
||||
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
|
||||
{% include 'partials/breadcrumbs.html.twig' %}
|
||||
{% endif %}
|
||||
|
||||
<h2>
|
||||
{{page_title}}
|
||||
</h2>
|
||||
|
||||
{% for child in collection %}
|
||||
{% include 'partials/blog_item.html.twig' with {'page':child, 'truncate':true} %}
|
||||
{% endfor %}
|
||||
|
|
Loading…
Add table
Reference in a new issue