mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-06-07 20:08:54 +00:00
Redefined the url of the base page for the blog
This commit is contained in:
parent
611caa23c0
commit
7b978aab42
2 changed files with 8 additions and 24 deletions
|
@ -1,8 +1,7 @@
|
|||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% set collection = page.collection() %}
|
||||
{% set base_url = page.url %}
|
||||
{% set feed_url = base_url %}
|
||||
{% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
|
||||
{% set show_breadcrumbs = header_var('show_breadcrumbs')|defined(true) %}
|
||||
{% set show_pagination = header_var('show_pagination')|defined(true) %}
|
||||
|
||||
|
@ -13,18 +12,12 @@
|
|||
{% 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') %}
|
||||
{% elseif uri.param('archives_month') %}
|
||||
{% set listing_title = 'FUTURE.BLOG.LISTING_TITLE_MONTH'|t ~ uri.param('archives_month')|replace({'_': ' '}) %}
|
||||
{% 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 %}
|
||||
|
@ -50,16 +43,16 @@
|
|||
{% 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} %}
|
||||
{% include 'partials/blog_item.html.twig' with {blog: page, 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} %}
|
||||
{% 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' %}
|
||||
{% include 'partials/sidebar-bits/footer.html.twig' %}
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,18 +1,9 @@
|
|||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% set base_url = page.parent.url %}
|
||||
{% set feed_url = base_url %}
|
||||
{% set blog = page.find(header_var('blog_url')|defined(theme_var('blog_page'))) %}
|
||||
{% set show_breadcrumbs = header_var('show_breadcrumbs')|defined(true) %}
|
||||
{% set show_sidebar = header_var('show_sidebar')|defined(false) %}
|
||||
|
||||
{% if base_url == '/' %}
|
||||
{% set base_url = '' %}
|
||||
{% endif %}
|
||||
|
||||
{% if base_url == base_url_relative %}
|
||||
{% set feed_url = base_url~'/'~page.parent.slug %}
|
||||
{% endif %}
|
||||
|
||||
{% block menu %}
|
||||
{% include 'partials/sidebar_right.html.twig' %}
|
||||
{% endblock %}
|
||||
|
@ -28,7 +19,7 @@
|
|||
|
||||
{% if show_sidebar == false %}
|
||||
<section id="footer" class="align-center">
|
||||
{% include 'partials/footer.html.twig' %}
|
||||
{% include 'partials/sidebar-bits/footer.html.twig' %}
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Reference in a new issue