diff --git a/templates/blog.html.twig b/templates/blog.html.twig index 12fc982..3c9743a 100644 --- a/templates/blog.html.twig +++ b/templates/blog.html.twig @@ -1,51 +1,49 @@ -{% extends 'partials/base.html.twig' %} +{% embed 'partials/base.html.twig' %} -{% set collection = page.collection() %} -{% set base_url = page.url %} -{% set feed_url = base_url %} -{% if page.header.show_breadcrumbs is defined %} + {% set collection = page.collection() %} + {% set base_url = page.url %} + {% set feed_url = base_url %} + {% if page.header.show_breadcrumbs is defined %} {% set show_breadcrumbs = page.header.show_breadcrumbs %} -{% else %} - {% set show_breadcrumbs = true %} -{% endif %} -{% if page.header.show_pagination is defined %} - {% set show_pagination = page.header.show_pagination %} -{% else %} - {% set show_pagination = true %} -{% endif %} + {% else %} + {% set show_breadcrumbs = true %} + {% endif %} + {% if page.header.show_pagination is defined %} + {% set show_pagination = page.header.show_pagination %} + {% else %} + {% set show_pagination = true %} + {% endif %} -{% if base_url == '/' %} + {% if base_url == '/' %} {% set base_url = '' %} -{% endif %} + {% endif %} -{% if base_url == base_url_relative %} + {% if base_url == base_url_relative %} {% set feed_url = base_url~'/'~page.slug %} -{% endif %} + {% endif %} -{% block menu %} + {% block menu %} {% include 'partials/sidebar_right.html.twig' %} -{% endblock %} - -{% block content %} - {% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %} - {% include 'partials/breadcrumbs.html.twig' %} - {% endif %} -{# - {% 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 %} -#} - {% for child in collection %} - {% if child.header.hide is not defined or not child.header.hide %} - {% include 'partials/blog_item.html.twig' with {'page':child, 'truncate':true} %} + {% endblock %} + + {% block content %} + {% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %} + {% include 'partials/breadcrumbs.html.twig' %} {% endif %} - {% 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 %} + {% for child in collection %} + {% include 'partials/blog_item.html.twig' with {'page':child, '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 %} + {% endblock %} + + {% block sidebar %} + {% include 'partials/sidebar_left.html.twig' %} + {% endblock %} + +{% endembed %} + - -{% endblock %} diff --git a/templates/default.html.twig b/templates/default.html.twig index ec3ecd3..ffdc1a6 100644 --- a/templates/default.html.twig +++ b/templates/default.html.twig @@ -1,33 +1,34 @@ {% extends 'partials/base.html.twig' %} -{% if page.header.show_breadcrumbs is defined %} - {% set show_breadcrumbs = page.header.show_breadcrumbs %} -{% else %} - {% set show_breadcrumbs = true %} -{% endif %} - {% block menu %} - {% include 'partials/sidebar_right.html.twig' %} + {% include 'partials/sidebar_right.html.twig' %} {% endblock %} {% block content %} - {% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %} - {% include 'partials/breadcrumbs.html.twig' %} - {% endif %} +
+
+
+

{{ page.header.title }}

+ {% if page.header.subtitle %} +

{{ page.header.subtitle }}

+ {% endif %} +
-
-
-
-

{{ page.header.title }}

- {% if page.header.subtitle %} -

{{ page.header.subtitle }}

- {% endif %} -
-
- {{ page.content|raw }} -
- - +
+ {% if page.header.primaryImage %} + {{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {% else %} + {{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {% endif %} + {{ page.content|raw}} + +
+ {% endblock %} + + + diff --git a/templates/item.html.twig b/templates/item.html.twig index dbe1a6a..baa5f01 100644 --- a/templates/item.html.twig +++ b/templates/item.html.twig @@ -1,23 +1,31 @@ -{% extends 'partials/base.html.twig' %} +{% embed 'partials/base.html.twig' %} + {% set base_url = page.parent.url %} + {% set feed_url = base_url %} + {% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog]) %} -{% if page.header.show_breadcrumbs is defined %} - {% set show_breadcrumbs = page.header.show_breadcrumbs %} -{% else %} - {% set show_breadcrumbs = true %} -{% endif %} - -{% block menu %} - {% include 'partials/sidebar_right.html.twig' %} -{% endblock %} - -{% block content %} - {% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %} - {% include 'partials/breadcrumbs.html.twig' %} + {% if base_url == '/' %} + {% set base_url = '' %} {% endif %} - {% include 'partials/blog_item.html.twig' with {'truncate':false} %} + {% if base_url == base_url_relative %} + {% set feed_url = base_url~'/'~page.parent.slug %} + {% endif %} + + {% block menu %} + {% include 'partials/sidebar_right.html.twig' %} + {% endblock %} - -{% endblock %} + {% block content %} + + {% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %} + {% include 'partials/breadcrumbs.html.twig' %} + {% endif %} + + {% include 'partials/blog_item.html.twig' with {'truncate':false} %} + + + {% endblock %} + +{% endembed %} diff --git a/templates/partials/blog_item.html.twig b/templates/partials/blog_item.html.twig index 592ab9a..38dd6e9 100644 --- a/templates/partials/blog_item.html.twig +++ b/templates/partials/blog_item.html.twig @@ -1,87 +1,93 @@ -
-{% if page.header.author %} - {% set author = page.header.author %} -{% else %} - {% set author = page.header.taxonomy.author[0] %} -{% endif %} -{% if author %} - {% set avatar = author|replace(' ', '-')|lower %} -{% endif %} - -
+
+ {% if page.header.author %} + {% set author = page.header.author %} + {% else %} + {% set author = page.header.taxonomy.author[0] %} + {% endif %} + {% if author %} + {% set avatar = author|replace(' ', '-')|lower %} + {% endif %} + +
- {% if page.header.link %} -

- {% if page.header.continue_link is not sameas(false) %} - + {% if page.header.link %} +

+ {% if page.header.continue_link is not sameas(false) %} + + {% endif %} + {{ page.title }} +

+ {% else %} +

{{ page.title }}

+ {% endif %} + {% if page.header.subtitle %} +

{{ page.header.subtitle|raw }}

{% endif %} - {{ page.title }} - - {% else %} -

{{ page.title }}

- {% endif %} - {% if page.header.subtitle %} -

{{ page.header.subtitle|raw }}

- {% endif %}
- - {% if author %} - {{ tag }}{% if page.header.avatarImage %}{{ author }}{% endif %} - {% endif %} + + {% if author %} + {{ tag }}{% if page.header.avatarImage %}{{ author }}{% endif %} + {% endif %}
-
+
-{% if page.header.primaryImage %} - {{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title)|raw }} -{% elseif page.media.images %} - {{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title)|raw }} -{% endif %} + {% if page.header.primaryImage %} + {{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {% else %} + {{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {% endif %} -{% if page.header.blog_hide_body is not defined or not page.header.blog_hide_body %} -
- {% if page.header.continue_link is sameas(false) %} - {{ page.content|raw }} - {% if not truncate %} - {% set show_prev_next = true %} - {% endif %} - {% elseif truncate and page.summary != page.content %} - {{ page.summary|raw }} - {% elseif truncate %} - {{ page.content|truncate(550)|raw }} - {% else %} - {{ page.content|raw }} - {% set show_prev_next = true %} - {% endif %} -
-{% endif %} + +
+ + {% if page.header.continue_link is sameas(false) %} + {{ page.content|raw }} + {% if not truncate %} + {% set show_prev_next = true %} + {% endif %} + {% elseif truncate and page.summary != page.content %} + {{ page.summary|raw }} + {% elseif truncate %} + {{ page.content|truncate(550)|raw }} + {% else %} + {{ page.content|raw }} + {% set show_prev_next = true %} + {% endif %} -
+
+ + + + + +