diff --git a/templates/blog.html.twig b/templates/blog.html.twig index eef52b7..854dd6a 100755 --- a/templates/blog.html.twig +++ b/templates/blog.html.twig @@ -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 %} {% 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 %} {% endif %} {% endblock %} diff --git a/templates/item.html.twig b/templates/item.html.twig index 67166af..0d4cff6 100755 --- a/templates/item.html.twig +++ b/templates/item.html.twig @@ -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 %} {% endif %} {% endblock %}