From 63235cb2b9b4f6e545931d12fb7c859c217ae0bd Mon Sep 17 00:00:00 2001 From: pikim Date: Thu, 19 Jan 2023 21:22:31 +0100 Subject: [PATCH 01/54] Rename custom.css to misc.css as custom.css is used for theme inheritance --- assets/css/{custom.css => misc.css} | 7 +++---- templates/partials/base.html.twig | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) rename assets/css/{custom.css => misc.css} (95%) diff --git a/assets/css/custom.css b/assets/css/misc.css similarity index 95% rename from assets/css/custom.css rename to assets/css/misc.css index 651a2f3..0bf6775 100644 --- a/assets/css/custom.css +++ b/assets/css/misc.css @@ -16,7 +16,7 @@ position: fixed; bottom: 30px; right: 30px; - transition: background-color .3s, + transition: background-color .3s, opacity .5s, visibility .5s; opacity: 0; visibility: hidden; @@ -66,7 +66,6 @@ .search-row { display: flex; align-items: top; - } .search-image img { overflow:hidden; @@ -76,9 +75,9 @@ object-position: 0 100%; } @media only all and (max-width: 47.938em) { - .search-image img {display:none;} + .search-image img {display:none;} } .search-item { margin-left: 30px; margin-bottom: 50px; -} \ No newline at end of file +} diff --git a/templates/partials/base.html.twig b/templates/partials/base.html.twig index a31908f..30191be 100644 --- a/templates/partials/base.html.twig +++ b/templates/partials/base.html.twig @@ -19,7 +19,8 @@ {% block stylesheets %} {% do assets.addCss('theme://assets/css/main'~compress) %} {% do assets.addCss('theme://assets/css/fontawesome-all.min.css') %} - {% do assets.addCss('theme://assets/css/custom.css', 10) %} + {% do assets.addCss('theme://assets/css/misc.css') %} + {% do assets.addCss('theme://assets/css/custom.css', 5) %} {% if page.template() == 'portfolio' %} {% do assets.addCss('theme://assets/css/glightbox.min.css') %} {% endif %} From 269c3f0cce7c181b132383cca14f684a80445d3b Mon Sep 17 00:00:00 2001 From: pikim Date: Thu, 19 Jan 2023 21:30:40 +0100 Subject: [PATCH 02/54] Translate date if translate_date plugin is enabled --- templates/formdata.html.twig | 6 +++++- templates/partials/archives.html.twig | 6 +++++- templates/partials/blog_item.html.twig | 8 ++++++-- templates/partials/miniposts.html.twig | 6 +++++- templates/partials/simplesearch_item.html.twig | 4 ++++ 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/templates/formdata.html.twig b/templates/formdata.html.twig index bff3f77..7372b60 100644 --- a/templates/formdata.html.twig +++ b/templates/formdata.html.twig @@ -5,7 +5,11 @@

{{ form.message }}

- + {% if plugin.translate_date.enabled %} + + {% else %} + + {% endif %}

{{'FUTURE.FORM_SUMMARY'|t}}

diff --git a/templates/partials/archives.html.twig b/templates/partials/archives.html.twig index a4ca12c..c6084de 100644 --- a/templates/partials/archives.html.twig +++ b/templates/partials/archives.html.twig @@ -11,7 +11,11 @@

{{ p.title }}

- + {% if plugin.translate_date.enabled %} + + {% else %} + + {% endif %}
{{ bannerimage.cropZoom(64,64).quality(60).loading('lazy').html('',p.title)|raw }} diff --git a/templates/partials/blog_item.html.twig b/templates/partials/blog_item.html.twig index 2c58db3..d8f99c3 100644 --- a/templates/partials/blog_item.html.twig +++ b/templates/partials/blog_item.html.twig @@ -29,7 +29,11 @@ {% endif %}
\ No newline at end of file + diff --git a/templates/partials/miniposts.html.twig b/templates/partials/miniposts.html.twig index 6fd99a7..c4e6259 100644 --- a/templates/partials/miniposts.html.twig +++ b/templates/partials/miniposts.html.twig @@ -11,7 +11,11 @@

{{ p.title }}

- + {% if plugin.translate_date.enabled %} + + {% else %} + + {% endif %}
diff --git a/templates/partials/simplesearch_item.html.twig b/templates/partials/simplesearch_item.html.twig index 3111f15..e147efa 100644 --- a/templates/partials/simplesearch_item.html.twig +++ b/templates/partials/simplesearch_item.html.twig @@ -13,7 +13,11 @@
+ {% if plugin.translate_date.enabled %} + {{ page.date|td(null, config.system.pages.dateformat.short) }} + {% else %} {{ page.date|date(config.system.pages.dateformat.short) }} + {% endif %}

{{ page.summary|truncate(200)|raw }}

From c64bd3a121ad05591cbcb5c1e9869eca9b028f1a Mon Sep 17 00:00:00 2001 From: pikim Date: Thu, 19 Jan 2023 21:31:31 +0100 Subject: [PATCH 03/54] Fix sidebar layout if simplesearch is disabled --- templates/partials/sidebar_right.html.twig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/partials/sidebar_right.html.twig b/templates/partials/sidebar_right.html.twig index 61f6c6e..8e74f53 100644 --- a/templates/partials/sidebar_right.html.twig +++ b/templates/partials/sidebar_right.html.twig @@ -1,10 +1,10 @@
diff --git a/templates/formdata.html.twig b/templates/formdata.html.twig index 425fe4f..2a07d31 100644 --- a/templates/formdata.html.twig +++ b/templates/formdata.html.twig @@ -1,22 +1,22 @@ {% extends 'partials/base.html.twig' %} {% block content %} -
+
-
-

{{ form.message }}

-
-
- {% if plugin.translate_date.enabled %} - - {% else %} - - {% endif %} -
-
-

{{'FUTURE.FORM_SUMMARY'|t}}

+
+

{{ form.message }}

+
+
+ {% if plugin.translate_date.enabled %} + + {% else %} + + {% endif %} +
+ +

{{'FUTURE.FORM_SUMMARY'|t}}

- {{ content|raw }} + {{ content|raw }} - {% include "forms/data.html.twig" %} -
+ {% include "forms/data.html.twig" %} +
{% endblock %} diff --git a/templates/forms/data.html.twig b/templates/forms/data.html.twig index f8a2756..afcb705 100644 --- a/templates/forms/data.html.twig +++ b/templates/forms/data.html.twig @@ -1,51 +1,48 @@ {% macro render_field(form, fields, scope) %} - {% import _self as self %} + {% import _self as self %} - {% for index, field in fields %} - {% set input = attribute(field, "input@") %} + {% for index, field in fields %} + {% set input = attribute(field, "input@") %} - {% if input is null or input == true %} + {% if input is null or input == true %} + {% if form.value(scope ~ field.name) %} + {% block field %} +
+ {% block field_name %} + {{ field.name|t|e }}: + {% endblock %} - {% if form.value(scope ~ field.name) %} - {% block field %} -
- {% block field_name %} - {{ field.name|t|e }}: - - {% endblock %} - - {% block field_value %} - {% if field.type == 'checkboxes' %} -
    - {% set use_keys = field.use is defined and field.use == 'keys' %} - {% for key,value in form.value(scope ~ field.name) %} - {% set index = (use_keys ? key : value) %} -
  • {{ field.options[index]|e }}
  • - {% endfor %} -
- {% elseif field.type == 'checkbox' %} - {{ (form.value(scope ~ field.name) == 1) ? "GRAV.YES"|t|e : "GRAV.NO"|t|e }} - {% elseif field.type == 'privacy' %} - {{ (form.value(scope ~ field.name) == 1) ? "Acepta la Política de Privacidad, Si"|t|e : "GRAV.NO"|t|e }} - {% elseif field.type == 'select' %} - {{ field.options[form.value(scope ~ field.name)]|e }} - {% else %} - {{ string(form.value(scope ~ field.name))|nl2br }} - {% endif %} - {% endblock %} -
- {% endblock %} - {% endif %} - {% else %} - {% if field.fields %} - {% set new_scope = field.nest_id ? scope ~ field.name ~ '.' : scope %} - {{ self.render_field(form, field.fields, new_scope) }} - {% endif %} - {% endif %} - {% endfor %} + {% block field_value %} + {% if field.type == 'checkboxes' %} +
    + {% set use_keys = field.use is defined and field.use == 'keys' %} + {% for key,value in form.value(scope ~ field.name) %} + {% set index = (use_keys ? key : value) %} +
  • {{ field.options[index]|e }}
  • + {% endfor %} +
+ {% elseif field.type == 'checkbox' %} + {{ (form.value(scope ~ field.name) == 1) ? "GRAV.YES"|t|e : "GRAV.NO"|t|e }} + {% elseif field.type == 'privacy' %} + {{ (form.value(scope ~ field.name) == 1) ? "Acepta la Política de Privacidad, Si"|t|e : "GRAV.NO"|t|e }} + {% elseif field.type == 'select' %} + {{ field.options[form.value(scope ~ field.name)]|e }} + {% else %} + {{ string(form.value(scope ~ field.name))|nl2br }} + {% endif %} + {% endblock %} +
+ {% endblock %} + {% endif %} + {% else %} + {% if field.fields %} + {% set new_scope = field.nest_id ? scope ~ field.name ~ '.' : scope %} + {{ self.render_field(form, field.fields, new_scope) }} + {% endif %} + {% endif %} + {% endfor %} {% endmacro %} {% import _self as macro %} {{ macro.render_field(form, form.fields, '') }} - diff --git a/templates/partials/archives.html.twig b/templates/partials/archives.html.twig index c6084de..8d9896b 100644 --- a/templates/partials/archives.html.twig +++ b/templates/partials/archives.html.twig @@ -1,27 +1,28 @@
-
    +
      {% for p in page.find(theme_config.blog_page).children.order('date', 'desc').slice(0, 5) %} - - {% if p.header.primaryImage %} - {% set bannerimage = p.media[p.header.primaryImage]%} - {% else %} - {% set bannerimage = p.media.images|first %} - {% endif %} -
    • + {% if p.header.primaryImage %} + {% set bannerimage = p.media[p.header.primaryImage]%} + {% else %} + {% set bannerimage = p.media.images|first %} + {% endif %} +
    • -
    • - {% endfor %} -
    + + + + {% endfor %} +
diff --git a/templates/partials/base.html.twig b/templates/partials/base.html.twig index 30191be..d0ff451 100644 --- a/templates/partials/base.html.twig +++ b/templates/partials/base.html.twig @@ -5,84 +5,91 @@ - - {% block head deferred %} - {% if page.title %}{{ page.title|e('html') }} | {% endif %}{{ site.title|e('html') }} - - - - {% include 'partials/metadata.html.twig' %} - - - {% endblock head %} + + {% block head deferred %} + + {% if page.title %} + {{ page.title|e('html') }} + {% endif %} + {{ site.title|e('html') }} + + + + {% include 'partials/metadata.html.twig' %} + + + {% endblock head %} - {% block stylesheets %} - {% do assets.addCss('theme://assets/css/main'~compress) %} - {% do assets.addCss('theme://assets/css/fontawesome-all.min.css') %} - {% do assets.addCss('theme://assets/css/misc.css') %} - {% do assets.addCss('theme://assets/css/custom.css', 5) %} - {% if page.template() == 'portfolio' %} - {% do assets.addCss('theme://assets/css/glightbox.min.css') %} - {% endif %} - {% endblock %} - {{ assets.css()|raw }} - - {% block javascripts %} - {% do assets.add('jquery',101) %} - {% do assets.addJs('theme://assets/js/browser.min.js', {group:'bottom'}) %} - {% do assets.addJs('theme://assets/js/breakpoints.min.js', {group:'bottom'}) %} - {% do assets.addJs('theme://assets/js/util.js', {group:'bottom'}) %} - {% do assets.addJs('theme://assets/js/main.js', {group:'bottom'}) %} - {% do assets.addJs('theme://assets/js/custom.js', {group:'bottom'}) %} - {% if page.template() == 'portfolio' %} - {% do assets.addJs('theme://assets/js/glightbox.min.js', {group:'bottom'}) %} - {% endif %} - {% endblock %} - {{ assets.js()|raw }} + {% block stylesheets %} + {% do assets.addCss('theme://assets/css/main'~compress) %} + {% do assets.addCss('theme://assets/css/fontawesome-all.min.css') %} + {% do assets.addCss('theme://assets/css/misc.css') %} + {% do assets.addCss('theme://assets/css/custom.css', 5) %} + {% if page.template() == 'portfolio' %} + {% do assets.addCss('theme://assets/css/glightbox.min.css') %} + {% endif %} + {% endblock %} + {{ assets.css()|raw }} - - - -
+ {% block javascripts %} + {% do assets.add('jquery',101) %} + {% do assets.addJs('theme://assets/js/browser.min.js', {group:'bottom'}) %} + {% do assets.addJs('theme://assets/js/breakpoints.min.js', {group:'bottom'}) %} + {% do assets.addJs('theme://assets/js/util.js', {group:'bottom'}) %} + {% do assets.addJs('theme://assets/js/main.js', {group:'bottom'}) %} + {% do assets.addJs('theme://assets/js/custom.js', {group:'bottom'}) %} + {% if page.template() == 'portfolio' %} + {% do assets.addJs('theme://assets/js/glightbox.min.js', {group:'bottom'}) %} + {% endif %} + {% endblock %} + {{ assets.js()|raw }} - {% block header %} - {% include 'partials/header.html.twig' %} + + + +
+ + {% block header %} + {% include 'partials/header.html.twig' %} + {% endblock %} + + {% block body %} + + {% block menu %}{% endblock %} + + {% block main %} +
+ {% block content %}{% endblock %} +
+ {% block sidebar %}{% endblock %} {% endblock %} - {% block body %} - - {% block menu %}{% endblock %} - - {% block main %} -
- {% block content %}{% endblock %} -
- {% block sidebar %}{% endblock %} - {% endblock %} - - {% endblock %} + {% endblock %} - + + + - {% block bottom %} - {{ assets.js('bottom')|raw }} - {% if page.template() == 'portfolio' %} - - {% endif %} - {% endblock %} -
- + {% block bottom %} + {{ assets.js('bottom')|raw }} + {% if page.template() == 'portfolio' %} + + {% endif %} + {% endblock %} +
+ diff --git a/templates/partials/blog_item.html.twig b/templates/partials/blog_item.html.twig index 1b9930a..61ddef4 100644 --- a/templates/partials/blog_item.html.twig +++ b/templates/partials/blog_item.html.twig @@ -1,98 +1,106 @@ -
- - {% if page.header.metadata.author %} - {% set author = page.header.metadata.author %} - {% elseif page.header.author %} - {% set author = page.header.author %} - {% else %} - {% set author = page.header.taxonomy.author[0] %} - {% endif %} - - {% if author %} +
+ + {% if page.header.metadata.author %} + {% set author = page.header.metadata.author %} + {% elseif 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 %} - -
+ {% endif %} + +
- {% if page.header.link %} + {% if page.header.link %}

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

- {% else %} -

{{ page.title }}

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

+ {{ page.title }} +

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

{{ page.header.subtitle|raw }}

- {% endif %} + {% endif %}
- {% if plugin.translate_date.enabled %} - - {% else %} - - {% endif %} - {% if author %} - {{ tag }}{% if page.header.avatarImage %}{{ author }}{% endif %} - {% endif %} + {% if plugin.translate_date.enabled %} + + {% else %} + + {% 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, 'image featured')|raw }} - {% elseif page.media.images %} - {{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} - {% endif %} + {% if page.header.primaryImage %} + {{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {% elseif page.media.images %} + {{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {% endif %} -
- +
{% if page.header.continue_link is sameas(false) %} - {{ page.content|raw }} - {% if not truncate %} + {{ page.content|raw }} + {% if not truncate %} {% set show_prev_next = true %} - {% endif %} + {% endif %} {% elseif truncate and page.summary != page.content %} - {{ page.summary|raw }} + {{ page.summary|raw }} {% elseif truncate %} - {{ page.content|truncate(550)|raw }} + {{ page.content|truncate(550)|raw }} {% else %} - {{ page.content|raw }} - {% set show_prev_next = true %} + {{ page.content|raw }} + {% set show_prev_next = true %} {% endif %} +
-
- -
From 86058f647b4ed16cd3390c3132d376f9b2c26d62 Mon Sep 17 00:00:00 2001 From: pikim Date: Thu, 19 Jan 2023 23:09:30 +0100 Subject: [PATCH 13/54] Add line break --- templates/partials/base.html.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/partials/base.html.twig b/templates/partials/base.html.twig index d0ff451..787544a 100644 --- a/templates/partials/base.html.twig +++ b/templates/partials/base.html.twig @@ -11,7 +11,8 @@ {% if page.title %} {{ page.title|e('html') }} {% endif %} - {{ site.title|e('html') }} + {{ site.title|e('html') }} + From 10cacf09831928d3a1fb4751aeffe752cfcabfc5 Mon Sep 17 00:00:00 2001 From: pikim Date: Thu, 19 Jan 2023 23:16:37 +0100 Subject: [PATCH 14/54] Use only one line --- templates/partials/base.html.twig | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/templates/partials/base.html.twig b/templates/partials/base.html.twig index 787544a..f857aaa 100644 --- a/templates/partials/base.html.twig +++ b/templates/partials/base.html.twig @@ -7,12 +7,7 @@ {% block head deferred %} - - {% if page.title %} - {{ page.title|e('html') }} - {% endif %} - {{ site.title|e('html') }} - + {% if page.title %}{{ page.title|e('html') }} | {% endif %}{{ site.title|e('html') }} From 05a45ecb9447875c422eafea32e61859c13a18b9 Mon Sep 17 00:00:00 2001 From: pikim Date: Thu, 19 Jan 2023 23:35:23 +0100 Subject: [PATCH 15/54] Remove erratic /a tag --- templates/partials/sidebar_left.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/partials/sidebar_left.html.twig b/templates/partials/sidebar_left.html.twig index dbb7ec6..e593324 100644 --- a/templates/partials/sidebar_left.html.twig +++ b/templates/partials/sidebar_left.html.twig @@ -4,7 +4,7 @@ {% include 'partials/logo.html.twig' %}

{{ site.title|e('html') }}

-

{{theme_config.slogan|raw}}

+

{{theme_config.slogan|raw}}

From 3fe6574d0be98763f36eeacaa98f9dddd669cc6c Mon Sep 17 00:00:00 2001 From: pikim Date: Thu, 19 Jan 2023 23:36:48 +0100 Subject: [PATCH 16/54] Autoformatted some twigs --- templates/modular.html.twig | 38 +++---- templates/partials/miniposts.html.twig | 34 +++--- templates/partials/sidebar_left.html.twig | 28 ++--- .../partials/sidebar_navigation.html.twig | 87 +++++++------- templates/partials/sidebar_right.html.twig | 106 +++++++++--------- 5 files changed, 149 insertions(+), 144 deletions(-) diff --git a/templates/modular.html.twig b/templates/modular.html.twig index 39f5d4a..3a49e2e 100644 --- a/templates/modular.html.twig +++ b/templates/modular.html.twig @@ -1,30 +1,32 @@ {% extends 'partials/base.html.twig' %} {% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %} -{% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %} +{% macro pageLinkName(text) %} + {{ text|lower|replace({' ':'_'}) }} +{% endmacro %} {% block menu %} {% include 'partials/sidebar_right.html.twig' %} {% endblock %} {% block content %} -
-
-
-

{{ page.header.title }}

-
-
+
+
+
+

{{ page.header.title }}

+
+
- {% 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}} - {% for module in page.collection() %} - {{ module.content|raw }} - {% endfor %} -
+ {% 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}} + {% for module in page.collection() %} + {{ module.content|raw }} + {% endfor %} +
{% endblock %} {% block sidebar %} @@ -32,5 +34,3 @@ {% include 'partials/sidebar_left.html.twig' %} {% endif %} {% endblock %} - - diff --git a/templates/partials/miniposts.html.twig b/templates/partials/miniposts.html.twig index c4e6259..d70dd2f 100644 --- a/templates/partials/miniposts.html.twig +++ b/templates/partials/miniposts.html.twig @@ -2,34 +2,32 @@ {% set miniposts_number = config.theme.miniposts_number %}
-
+

{{ 'FUTURE.FEATURED'|t }}

-
-
- +
+
{% for p in page.evaluate({'@taxonomy.category':miniposts_category}).order('header.order', 'asc').slice(0,miniposts_number) %} -
+
-

{{ p.title }}

- {% if plugin.translate_date.enabled %} +

+ {{ p.title }} +

+ {% if plugin.translate_date.enabled %} - {% else %} + {% else %} - {% endif %} - + {% endif %} +
- - {% if p.header.primaryImage %} + {% if p.header.primaryImage %} {{ p.media[p.header.primaryImage].cropZoom(1038,437).loading('lazy').html('',p.title)|raw}} - {% else %} + {% else %} {{p.media.images|first.cropZoom(1038,437).loading('lazy').html('',p.title)|raw}} - {% endif %} + {% endif %} -
- +
{% endfor %} -
+
- diff --git a/templates/partials/sidebar_left.html.twig b/templates/partials/sidebar_left.html.twig index e593324..b329e09 100644 --- a/templates/partials/sidebar_left.html.twig +++ b/templates/partials/sidebar_left.html.twig @@ -9,24 +9,24 @@ {% if theme_config.miniposts == true %} - {% block miniposts %} - {% include 'partials/miniposts.html.twig' %} + {% block miniposts %} + {% include 'partials/miniposts.html.twig' %} {% endblock %} {% endif %} {% if theme_config.footer.title or theme_config.footer.description %} -
-

{{theme_config.footer.title}}

-

{{theme_config.footer.description}}

- -
+
+

{{theme_config.footer.title}}

+

{{theme_config.footer.description}}

+ +
{% endif %} - \ No newline at end of file + {% block footer %} + {% include 'partials/footer.html.twig' %} + {% endblock %} + + diff --git a/templates/partials/sidebar_navigation.html.twig b/templates/partials/sidebar_navigation.html.twig index 0c4856c..1bf6c17 100644 --- a/templates/partials/sidebar_navigation.html.twig +++ b/templates/partials/sidebar_navigation.html.twig @@ -1,40 +1,47 @@ -{% block menu_navigation %} - {% macro loop(page) %} - {% for p in page.children.visible %} - {% set current_page = (p.active or p.activeChild) ? 'active' : '' %} - {% if p.children.visible.count > 0 %} -
  • - - {% if p.header.icon %}{% endif %} - {{ p.menu }}{% if p.routable ?? false %} {% endif %} - -
      - {{ _self.loop(p) }} -
    -
  • - {% else %} -
  • - - {% if p.header.icon %}{% endif %} - {{ p.menu }} - -
  • - {% endif %} - {% endfor %} - {% endmacro %} - -{% endblock %} \ No newline at end of file +{% block menu_navigation %} + {% macro loop(page) %} + {% for p in page.children.visible %} + {% set current_page = (p.active or p.activeChild) ? 'active' : '' %} + {% if p.children.visible.count > 0 %} +
  • + + {% if p.header.icon %} + + {% endif %} + {{ p.menu }} + {% if p.routable ?? false %}  + {% endif %} + + +
      + {{ _self.loop(p) }} +
    +
  • + {% else %} +
  • + + {% if p.header.icon %} + + {% endif %} + {{ p.menu }} + +
  • + {% endif %} + {% endfor %} + {% endmacro %} + +{% endblock %} diff --git a/templates/partials/sidebar_right.html.twig b/templates/partials/sidebar_right.html.twig index 4ea7871..ceea146 100644 --- a/templates/partials/sidebar_right.html.twig +++ b/templates/partials/sidebar_right.html.twig @@ -1,57 +1,57 @@ From f54d14e37be5885f81c10450685a77b38cbf3481 Mon Sep 17 00:00:00 2001 From: pikim Date: Thu, 19 Jan 2023 23:43:37 +0100 Subject: [PATCH 17/54] Convert tabs to spaces --- templates/partials/sidebar_left.html.twig | 60 +++++++++++------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/templates/partials/sidebar_left.html.twig b/templates/partials/sidebar_left.html.twig index b329e09..5cd473b 100644 --- a/templates/partials/sidebar_left.html.twig +++ b/templates/partials/sidebar_left.html.twig @@ -1,32 +1,32 @@ From 3667a1526b6de778851ee320324df6aa67bf9738 Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 00:01:33 +0100 Subject: [PATCH 18/54] Remove erratic /a tag --- templates/partials/footer.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/partials/footer.html.twig b/templates/partials/footer.html.twig index af096cd..35ff9d9 100644 --- a/templates/partials/footer.html.twig +++ b/templates/partials/footer.html.twig @@ -1,4 +1,4 @@
      {% include 'partials/social.html.twig' %}
    - + From 3318a384087a4733d5210aadb52ae787617045d7 Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 00:03:51 +0100 Subject: [PATCH 19/54] Autoformatted some twigs --- .../forms/fields/privacy/privacy.html.twig | 61 +++++++++---------- templates/macros/topmenu.html.twig | 51 +++++++++------- templates/modular/banner.html.twig | 44 ++++++------- templates/modular/contact.html.twig | 4 +- templates/modular/features.html.twig | 41 +++++++------ templates/partials/footer.html.twig | 2 +- 6 files changed, 108 insertions(+), 95 deletions(-) diff --git a/templates/forms/fields/privacy/privacy.html.twig b/templates/forms/fields/privacy/privacy.html.twig index 1227b4c..b3b26af 100644 --- a/templates/forms/fields/privacy/privacy.html.twig +++ b/templates/forms/fields/privacy/privacy.html.twig @@ -4,36 +4,35 @@ {% endblock %} {% block input %} - {% set id = field.id|default(field.name) ~ '-' ~ key %} - -
    - - -
    - +
    + + +
    {% endblock %} diff --git a/templates/macros/topmenu.html.twig b/templates/macros/topmenu.html.twig index ae0954b..80258a0 100644 --- a/templates/macros/topmenu.html.twig +++ b/templates/macros/topmenu.html.twig @@ -1,24 +1,31 @@ {% macro nav_loop(page) %} -{% import _self as macros %} + {% import _self as macros %} {% for p in page.children.visible %} - {% set current_page = (p.active or p.activeChild) ? 'active' : '' %} - {% if p.children.visible.count > 0 %} -
  • - - {% if p.header.icon %}{% endif %} - {{ p.menu }}{% if p.routable ?? false %} {% endif %} - -
      - {{ macros.nav_loop(p) }} -
    -
  • - {% else %} -
  • - - {% if p.header.icon %}{% endif %} - {{ p.menu }} - -
  • - {% endif %} - {% endfor %} -{% endmacro %} \ No newline at end of file + {% set current_page = (p.active or p.activeChild) ? 'active' : '' %} + {% if p.children.visible.count > 0 %} +
  • + + {% if p.header.icon %} + + {% endif %} + {{ p.menu }} + {% if p.routable ?? false %}  + {% endif %} + + +
      + {{ macros.nav_loop(p) }} +
    +
  • + {% else %} +
  • + + {% if p.header.icon %} + + {% endif %} + {{ p.menu }} + +
  • + {% endif %} + {% endfor %} +{% endmacro %} diff --git a/templates/modular/banner.html.twig b/templates/modular/banner.html.twig index 355cb12..2354e7b 100644 --- a/templates/modular/banner.html.twig +++ b/templates/modular/banner.html.twig @@ -1,25 +1,25 @@ diff --git a/templates/modular/contact.html.twig b/templates/modular/contact.html.twig index 88fd263..f169487 100644 --- a/templates/modular/contact.html.twig +++ b/templates/modular/contact.html.twig @@ -1,5 +1,5 @@
    -

    {{ page.content|raw }}

    - {% include "forms/form.html.twig" with { form: forms('contact-form')} %} +

    {{ page.content|raw }}

    + {% include "forms/form.html.twig" with { form: forms('contact-form')} %}

    diff --git a/templates/modular/features.html.twig b/templates/modular/features.html.twig index 6d876ad..a45bd20 100644 --- a/templates/modular/features.html.twig +++ b/templates/modular/features.html.twig @@ -1,30 +1,37 @@ {% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %}
    -
    +

    {{ page.title }}

    {% if page.header.subtitle %} -

    {{ page.header.subtitle }}

    +

    {{ page.header.subtitle }}

    {% endif %} -
    - {{ content|raw }} +
    + {{ content|raw }} -
    +
    {% for feature in page.header.features %} - -
    +
    - {% if feature.image %}{{feature.title}}{% endif %} -
    - {% if feature.title %}

    {{feature.title}}

    {% endif %} - {% if feature.text %}

    {{feature.text|raw}}

    {% endif %} - {% if feature.buttonurl %}

    {{feature.buttontext}}

    {% endif %} -
    + {% if feature.image %} + {{feature.title}} + {% endif %} +
    + {% if feature.title %} +

    {{feature.title}}

    + {% endif %} + {% if feature.text %} +

    {{feature.text|raw}}

    + {% endif %} + {% if feature.buttonurl %} +

    + {{feature.buttontext}} +

    + {% endif %} +
    -
    - +
    {% endfor %} -
    - +

    diff --git a/templates/partials/footer.html.twig b/templates/partials/footer.html.twig index 35ff9d9..e9c579c 100644 --- a/templates/partials/footer.html.twig +++ b/templates/partials/footer.html.twig @@ -1,4 +1,4 @@
      - {% include 'partials/social.html.twig' %} + {% include 'partials/social.html.twig' %}
    From ecc1d5c964982aa9fdf775c6e0deab04dafc9c70 Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 00:08:50 +0100 Subject: [PATCH 20/54] Autoformatted some twigs --- templates/partials/header.html.twig | 46 ++++++++++++----------- templates/partials/langswitcher.html.twig | 38 +++++++++---------- templates/partials/logo.html.twig | 14 +++---- templates/partials/metadata.html.twig | 2 +- templates/partials/navigation.html.twig | 26 ++++++------- templates/partials/pagination.html.twig | 41 ++++++++++---------- 6 files changed, 83 insertions(+), 84 deletions(-) diff --git a/templates/partials/header.html.twig b/templates/partials/header.html.twig index 7cc8e62..ba73542 100644 --- a/templates/partials/header.html.twig +++ b/templates/partials/header.html.twig @@ -1,23 +1,25 @@ \ No newline at end of file +

    + {{ site.title }} +

    + + + diff --git a/templates/partials/langswitcher.html.twig b/templates/partials/langswitcher.html.twig index 0cd0f7c..d2e1518 100644 --- a/templates/partials/langswitcher.html.twig +++ b/templates/partials/langswitcher.html.twig @@ -1,31 +1,31 @@
  • -{% set display_format = display_format ?? config.get('plugins.langswitcher.language_display', 'long') %} -{% for language in langswitcher.languages %} + {% set display_format = display_format ?? config.get('plugins.langswitcher.language_display', 'long') %} + {% for language in langswitcher.languages %} {% set show_language = true %} {% if language == langswitcher.current %} - {% set lang_url = page.url %} - {% set active_class = ' active' %} + {% set lang_url = page.url %} + {% set active_class = ' active' %} {% else %} - {% set base_lang_url = base_url_simple ~ grav.language.getLanguageURLPrefix(language) %} - {% set lang_url = base_lang_url ~ langswitcher.page_route ~ page.urlExtension %} - {% set untranslated_pages_behavior = grav.config.plugins.langswitcher.untranslated_pages_behavior %} - {% if untranslated_pages_behavior != 'none' %} - {% set translated_page = langswitcher.translated_pages[language] %} - {% if (not translated_page) or (not translated_page.published) %} - {% if untranslated_pages_behavior == 'redirect' %} - {% set lang_url = base_lang_url ~ '/' %} - {% elseif untranslated_pages_behavior == 'hide' %} - {% set show_language = false %} - {% endif %} - {% endif %} + {% set base_lang_url = base_url_simple ~ grav.language.getLanguageURLPrefix(language) %} + {% set lang_url = base_lang_url ~ langswitcher.page_route ~ page.urlExtension %} + {% set untranslated_pages_behavior = grav.config.plugins.langswitcher.untranslated_pages_behavior %} + {% if untranslated_pages_behavior != 'none' %} + {% set translated_page = langswitcher.translated_pages[language] %} + {% if (not translated_page) or (not translated_page.published) %} + {% if untranslated_pages_behavior == 'redirect' %} + {% set lang_url = base_lang_url ~ '/' %} + {% elseif untranslated_pages_behavior == 'hide' %} + {% set show_language = false %} + {% endif %} {% endif %} - {% set active_class = '' %} + {% endif %} + {% set active_class = '' %} {% endif %} {% if show_language %} - {% include 'partials/langswitcher-' ~ display_format ~ '.html.twig' %} + {% include 'partials/langswitcher-' ~ display_format ~ '.html.twig' %} {% endif %} -{% endfor %} + {% endfor %}
  • diff --git a/templates/partials/logo.html.twig b/templates/partials/logo.html.twig index c220b1c..867cb6c 100644 --- a/templates/partials/logo.html.twig +++ b/templates/partials/logo.html.twig @@ -1,9 +1,9 @@ {% set logo = theme_var(mobile ? 'custom_logo_mobile' : 'custom_logo') %} \ No newline at end of file + {% if logo %} + {% set logo_file = (logo|first).name %} + {{ site.title }} + {% else %} + {% include('@images/grav-logo.svg') %} + {% endif %} + diff --git a/templates/partials/metadata.html.twig b/templates/partials/metadata.html.twig index 2f08a0e..59deee3 100644 --- a/templates/partials/metadata.html.twig +++ b/templates/partials/metadata.html.twig @@ -1,3 +1,3 @@ {% for meta in page.metadata %} - + {% endfor %} diff --git a/templates/partials/navigation.html.twig b/templates/partials/navigation.html.twig index 282ad5a..4308b93 100644 --- a/templates/partials/navigation.html.twig +++ b/templates/partials/navigation.html.twig @@ -1,18 +1,18 @@ {% import 'macros/topmenu.html.twig' as macros %} diff --git a/templates/partials/pagination.html.twig b/templates/partials/pagination.html.twig index 5b6d1f5..1ce44c9 100644 --- a/templates/partials/pagination.html.twig +++ b/templates/partials/pagination.html.twig @@ -2,33 +2,30 @@ {% set base_url = base_url|default(page.url) %} {% if pagination|length > 1 %} - -
      +
        {% if pagination.hasPrev %} - {% set url = (base_url ~ pagination.params ~ pagination.prevUrl)|replace({'//':'/'}) %} -
      • + {% set url = (base_url ~ pagination.params ~ pagination.prevUrl)|replace({'//':'/'}) %} +
      • {% else %} -
      • {{'FUTURE.BLOG.PAGINATION.PREVIOUS'|t}}
      • +
      • {{'FUTURE.BLOG.PAGINATION.PREVIOUS'|t}}
      • {% endif %} {% for paginate in pagination %} - - {% if paginate.isCurrent %} -
      • {{ paginate.number }}
      • - {% elseif paginate.isInDelta %} - {% set url = (base_url ~ pagination.params ~ paginate.url)|replace({'//':'/'}) %} -
      • {{ paginate.number }}
      • - {% elseif paginate.isDeltaBorder %} -
      • - {% endif %} - + {% if paginate.isCurrent %} +
      • {{ paginate.number }}
      • + {% elseif paginate.isInDelta %} + {% set url = (base_url ~ pagination.params ~ paginate.url)|replace({'//':'/'}) %} +
      • {{ paginate.number }}
      • + {% elseif paginate.isDeltaBorder %} +
      • + {% endif %} {% endfor %} - {% if pagination.hasNext %} - {% set url = (base_url ~ pagination.params ~ pagination.nextUrl)|replace({'//':'/'}) %} -
      • - {% else %} -
      • {{'FUTURE.BLOG.PAGINATION.NEXT'|t}}
      • - {% endif %} -
      + {% if pagination.hasNext %} + {% set url = (base_url ~ pagination.params ~ pagination.nextUrl)|replace({'//':'/'}) %} +
    • + {% else %} +
    • {{'FUTURE.BLOG.PAGINATION.NEXT'|t}}
    • + {% endif %} +
    {% endif %} From 497b24e59420cc437fb6e60c9394fbe202464c78 Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 00:17:01 +0100 Subject: [PATCH 21/54] Autoformatted some twigs --- templates/partials/relatedpages.html.twig | 20 +++++---- .../partials/simplesearch_searchbox.html.twig | 42 +++++++++---------- .../simplesearch_searchbox_results.html.twig | 40 +++++++++--------- .../simplesearch_searchbox_sidebar.html.twig | 36 ++++++++-------- templates/partials/social.html.twig | 2 +- templates/partials/taxonomylist.html.twig | 10 ++--- 6 files changed, 76 insertions(+), 74 deletions(-) diff --git a/templates/partials/relatedpages.html.twig b/templates/partials/relatedpages.html.twig index 07cb74a..5a1cc38 100644 --- a/templates/partials/relatedpages.html.twig +++ b/templates/partials/relatedpages.html.twig @@ -1,11 +1,13 @@ \ No newline at end of file + + {% endif %} + {% endfor %} + diff --git a/templates/partials/simplesearch_searchbox.html.twig b/templates/partials/simplesearch_searchbox.html.twig index 7bb47b7..52bccfe 100644 --- a/templates/partials/simplesearch_searchbox.html.twig +++ b/templates/partials/simplesearch_searchbox.html.twig @@ -1,25 +1,25 @@ {% set min_chars = config.get('plugins.simplesearch.min_query_length', 3) %} \ No newline at end of file diff --git a/templates/partials/simplesearch_searchbox_results.html.twig b/templates/partials/simplesearch_searchbox_results.html.twig index 7fb0ecd..bc30b17 100644 --- a/templates/partials/simplesearch_searchbox_results.html.twig +++ b/templates/partials/simplesearch_searchbox_results.html.twig @@ -1,24 +1,24 @@ {% set min_chars = config.get('plugins.simplesearch.min_query_length', 3) %}
    -
    - 0 %} data-min="{{- min_chars -}}" {% endif %} - required - placeholder="{{"PLUGIN_SIMPLESEARCH.SEARCH_PLACEHOLDER"|t}}" - value="{{ query|e }}" - data-search-invalid="{{ "PLUGIN_SIMPLESEARCH.SEARCH_FIELD_MINIMUM_CHARACTERS"|t(min_chars)|raw }}" - data-search-separator="{{ config.system.param_sep }}" - data-search-input="{{ base_url }}{{ config.plugins.simplesearch.route == '@self' ? '' : (config.plugins.simplesearch.route == '/' ? '' : config.plugins.simplesearch.route) }}/query" - /> - {% if config.plugins.simplesearch.display_button %} - - {% endif %} -
    +
    + 0 %} data-min="{{- min_chars -}}" {% endif %} + required + placeholder="{{"PLUGIN_SIMPLESEARCH.SEARCH_PLACEHOLDER"|t}}" + value="{{ query|e }}" + data-search-invalid="{{ "PLUGIN_SIMPLESEARCH.SEARCH_FIELD_MINIMUM_CHARACTERS"|t(min_chars)|raw }}" + data-search-separator="{{ config.system.param_sep }}" + data-search-input="{{ base_url }}{{ config.plugins.simplesearch.route == '@self' ? '' : (config.plugins.simplesearch.route == '/' ? '' : config.plugins.simplesearch.route) }}/query" + /> + {% if config.plugins.simplesearch.display_button %} + + {% endif %} +
    diff --git a/templates/partials/simplesearch_searchbox_sidebar.html.twig b/templates/partials/simplesearch_searchbox_sidebar.html.twig index ba93861..073bd2a 100644 --- a/templates/partials/simplesearch_searchbox_sidebar.html.twig +++ b/templates/partials/simplesearch_searchbox_sidebar.html.twig @@ -1,22 +1,22 @@ {% set min_chars = config.get('plugins.simplesearch.min_query_length', 3) %} diff --git a/templates/partials/social.html.twig b/templates/partials/social.html.twig index 4f516f3..d0a298b 100644 --- a/templates/partials/social.html.twig +++ b/templates/partials/social.html.twig @@ -1,3 +1,3 @@ {% for item in theme_config.social %} -
  • {{item.name}}
  • +
  • {{item.name}}
  • {% endfor %} \ No newline at end of file diff --git a/templates/partials/taxonomylist.html.twig b/templates/partials/taxonomylist.html.twig index 1519e31..af9b08e 100644 --- a/templates/partials/taxonomylist.html.twig +++ b/templates/partials/taxonomylist.html.twig @@ -3,10 +3,10 @@ {% if taxlist %} -{% endif %} \ No newline at end of file +{% endif %} From 5062f435108a8637e76e5b2be6562b7385a8c6fc Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 00:28:57 +0100 Subject: [PATCH 22/54] Autoformatted some twigs --- templates/partials/blog_item.html.twig | 2 +- .../partials/simplesearch_item.html.twig | 45 +++++++++---------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/templates/partials/blog_item.html.twig b/templates/partials/blog_item.html.twig index 61ddef4..fb9a5af 100644 --- a/templates/partials/blog_item.html.twig +++ b/templates/partials/blog_item.html.twig @@ -91,8 +91,8 @@ {% endif %} {% endif %} - +
      {% if page.taxonomy.tag %} {% for tag in page.taxonomy.tag %} diff --git a/templates/partials/simplesearch_item.html.twig b/templates/partials/simplesearch_item.html.twig index e147efa..8510b5f 100644 --- a/templates/partials/simplesearch_item.html.twig +++ b/templates/partials/simplesearch_item.html.twig @@ -1,27 +1,26 @@
      + {% set banner = page.media[page.header.primaryImage].loading('lazy').html(page.title,page.title)|raw ?: page.media.images|first %} - {% set banner = page.media[page.header.primaryImage].loading('lazy').html(page.title,page.title)|raw ?: page.media.images|first %} - - {% if banner %} - - {% endif %} -
      - - -
      - {% if plugin.translate_date.enabled %} - {{ page.date|td(null, config.system.pages.dateformat.short) }} - {% else %} - {{ page.date|date(config.system.pages.dateformat.short) }} - {% endif %} -
      - -

      {{ page.summary|truncate(200)|raw }}

      - -
      + {% if banner %} + + {% endif %} +
      + + +
      + {% if plugin.translate_date.enabled %} + {{ page.date|td(null, config.system.pages.dateformat.short) }} + {% else %} + {{ page.date|date(config.system.pages.dateformat.short) }} + {% endif %} +
      + +

      {{ page.summary|truncate(200)|raw }}

      + +
      +
      From 2247dced96bd2e8029bc81ea914346c05dee5f1e Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 15:39:02 +0100 Subject: [PATCH 23/54] Use extends instead of embed --- templates/blog.html.twig | 4 +--- templates/item.html.twig | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/templates/blog.html.twig b/templates/blog.html.twig index 6ce4c52..b97fc31 100644 --- a/templates/blog.html.twig +++ b/templates/blog.html.twig @@ -1,4 +1,4 @@ -{% embed 'partials/base.html.twig' %} +{% extends 'partials/base.html.twig' %} {% set collection = page.collection() %} {% set base_url = page.url %} @@ -59,5 +59,3 @@ {% include 'partials/sidebar_left.html.twig' %} {% endif %} {% endblock %} - -{% endembed %} \ No newline at end of file diff --git a/templates/item.html.twig b/templates/item.html.twig index baa5f01..6407640 100644 --- a/templates/item.html.twig +++ b/templates/item.html.twig @@ -1,4 +1,4 @@ -{% embed 'partials/base.html.twig' %} +{% extends 'partials/base.html.twig' %} {% set base_url = page.parent.url %} {% set feed_url = base_url %} {% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog]) %} @@ -27,5 +27,3 @@ {% include 'partials/footer.html.twig' %} {% endblock %} - -{% endembed %} From 7909c59e83799975af55379bc1c63c23f2717bf0 Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 15:40:05 +0100 Subject: [PATCH 24/54] Replace hr tag with border-bottom --- assets/css/misc.css | 1 + templates/partials/simplesearch_item.html.twig | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/css/misc.css b/assets/css/misc.css index 0bf6775..773ca60 100644 --- a/assets/css/misc.css +++ b/assets/css/misc.css @@ -64,6 +64,7 @@ /* Styles to support svg images in search results */ .search-row { + border-bottom: solid 1px rgba(160, 160, 160, 0.3); display: flex; align-items: top; } diff --git a/templates/partials/simplesearch_item.html.twig b/templates/partials/simplesearch_item.html.twig index 8510b5f..d51658f 100644 --- a/templates/partials/simplesearch_item.html.twig +++ b/templates/partials/simplesearch_item.html.twig @@ -20,7 +20,5 @@

      {{ page.summary|truncate(200)|raw }}

      - -
      From a5a775bb320aaccb9c70f615ca9aa7424d2209d6 Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 15:41:47 +0100 Subject: [PATCH 25/54] Autoformatted some twigs --- templates/blog.html.twig | 102 +++++++++++------------ templates/default.html.twig | 30 +++---- templates/error.html.twig | 12 +-- templates/item.html.twig | 46 +++++----- templates/offline.html.twig | 20 ++--- templates/partials/blog_item.html.twig | 6 +- templates/portfolio.html.twig | 51 ++++++------ templates/simplesearch_results.html.twig | 47 +++++------ 8 files changed, 157 insertions(+), 157 deletions(-) diff --git a/templates/blog.html.twig b/templates/blog.html.twig index b97fc31..e9905f1 100644 --- a/templates/blog.html.twig +++ b/templates/blog.html.twig @@ -1,61 +1,61 @@ {% extends '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 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 %} - -{% if uri.param('category') %} - {% set page_title = theme_config.listing_title.taxonomy.category | default('Posts in Category: ') ~ uri.param('category') %} -{% elseif uri.param('tag') %} - {% set page_title = theme_config.listing_title.taxonomy.tag | default('Posts with Tag: ') ~ uri.param('tag') %} -{% elseif uri.param('author') %} - {% set page_title = theme_config.listing_title.taxonomy.author | default('Posts from Author: ') ~ uri.param('author') %} +{% 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 page_title = theme_config.listing_title.blog | default('') %} + {% 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 == '/' %} - {% set base_url = '' %} +{% if uri.param('category') %} + {% set page_title = theme_config.listing_title.taxonomy.category | default('Posts in Category: ') ~ uri.param('category') %} +{% elseif uri.param('tag') %} + {% set page_title = theme_config.listing_title.taxonomy.tag | default('Posts with Tag: ') ~ uri.param('tag') %} +{% elseif uri.param('author') %} + {% set page_title = theme_config.listing_title.taxonomy.author | default('Posts from Author: ') ~ uri.param('author') %} +{% else %} + {% set page_title = theme_config.listing_title.blog | default('') %} +{% 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 %} + +{% block content %} + {% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %} + {% include 'partials/breadcrumbs.html.twig' %} {% endif %} - {% if base_url == base_url_relative %} - {% set feed_url = base_url~'/'~page.slug %} - {% endif %} +

      + {{page_title}} +

      - {% 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 %} - -

      - {{page_title}} -

      - - {% for child in collection %} - {% include 'partials/blog_item.html.twig' with {'page':child, 'truncate':true} %} - {% endfor %} + {% 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 %} + {% 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 %} - {% if theme_config.sidebar == true %} - {% include 'partials/sidebar_left.html.twig' %} - {% endif %} - {% endblock %} +{% block sidebar %} + {% if theme_config.sidebar == true %} + {% include 'partials/sidebar_left.html.twig' %} + {% endif %} +{% endblock %} diff --git a/templates/default.html.twig b/templates/default.html.twig index 449046c..bb40978 100644 --- a/templates/default.html.twig +++ b/templates/default.html.twig @@ -8,22 +8,24 @@
      -

      {{ page.header.title }}

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

      {{ page.header.subtitle }}

      - {% endif %} +

      {{ page.header.title }}

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

      {{ page.header.subtitle }}

      + {% 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 %} + + {{ 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}} -
      + + {% include 'partials/footer.html.twig' %} + {% endblock %} diff --git a/templates/error.html.twig b/templates/error.html.twig index 8e55c3c..ad5d6c0 100644 --- a/templates/error.html.twig +++ b/templates/error.html.twig @@ -5,12 +5,12 @@ {% endblock %} {% block content %} -
      +
      -
      -

      Error {{ page.header.http_response_code }}

      -

      {{ page.content|raw }}

      -
      +
      +

      Error {{ page.header.http_response_code }}

      +

      {{ page.content|raw }}

      +
      -
      +
      {% endblock %} diff --git a/templates/item.html.twig b/templates/item.html.twig index 6407640..adb706b 100644 --- a/templates/item.html.twig +++ b/templates/item.html.twig @@ -1,29 +1,29 @@ {% extends '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 base_url == '/' %} - {% set base_url = '' %} - {% endif %} +{% set base_url = page.parent.url %} +{% set feed_url = base_url %} +{% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog]) %} - {% if base_url == base_url_relative %} - {% set feed_url = base_url~'/'~page.parent.slug %} - {% endif %} - - {% block menu %} - {% include 'partials/sidebar_right.html.twig' %} - {% endblock %} +{% if base_url == '/' %} + {% set base_url = '' %} +{% endif %} - {% block content %} - - {% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %} - {% include 'partials/breadcrumbs.html.twig' %} - {% endif %} +{% if base_url == base_url_relative %} + {% set feed_url = base_url~'/'~page.parent.slug %} +{% endif %} - {% include 'partials/blog_item.html.twig' with {'truncate':false} %} +{% 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 %} diff --git a/templates/offline.html.twig b/templates/offline.html.twig index 5f8ad16..a7c4841 100644 --- a/templates/offline.html.twig +++ b/templates/offline.html.twig @@ -3,16 +3,16 @@ {% block header %}{% endblock %} {% block content %} -
      +
      -
      -

      {{ site.title }}

      -

      Error {{ page.header.http_response_code }}

      -

      {{ page.content|raw }}

      -
      +
      +

      {{ site.title }}

      +

      Error {{ page.header.http_response_code }}

      +

      {{ page.content|raw }}

      +
      -
      - +
      + {% endblock %} diff --git a/templates/partials/blog_item.html.twig b/templates/partials/blog_item.html.twig index fb9a5af..dfc87b1 100644 --- a/templates/partials/blog_item.html.twig +++ b/templates/partials/blog_item.html.twig @@ -1,11 +1,11 @@
      {% if page.header.metadata.author %} - {% set author = page.header.metadata.author %} + {% set author = page.header.metadata.author %} {% elseif page.header.author %} - {% set author = page.header.author %} + {% set author = page.header.author %} {% else %} - {% set author = page.header.taxonomy.author[0] %} + {% set author = page.header.taxonomy.author[0] %} {% endif %} {% if author %} diff --git a/templates/portfolio.html.twig b/templates/portfolio.html.twig index 43ed5ec..803b71f 100644 --- a/templates/portfolio.html.twig +++ b/templates/portfolio.html.twig @@ -8,38 +8,39 @@ {% block content %} -
      -
      -
      -

      {{ page.header.title }}

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

      {{ page.header.subtitle }}

      - {% endif %} -
      -
      - {% if page.header.primaryImage %} - {{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} +
      +
      +
      +

      {{ 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 }} + {% endif %} + + {{ page.content|raw}} + - {% block portfolio %} -
      + {% block portfolio %} +
      - {% for item in page.header.images %} + {% for item in page.header.images %} - {% endfor %} + {% endfor %}
      -
      +
      {% endblock %} -
      +
      - + {% endblock %} diff --git a/templates/simplesearch_results.html.twig b/templates/simplesearch_results.html.twig index d56a984..0d8aa49 100644 --- a/templates/simplesearch_results.html.twig +++ b/templates/simplesearch_results.html.twig @@ -5,38 +5,35 @@ {% endblock %} {% block content %} -
      +
      -
      - +
      {% block results %} -
      -

      {{ "PLUGIN_SIMPLESEARCH.SEARCH_RESULTS"|t }}

      -
      - {% include 'partials/simplesearch_searchbox_results.html.twig' %} -
      -

      - {% if query %} - {% set count = search_results ? search_results.count : 0 %} - {% if count is same as( 1 ) %} - {{ "PLUGIN_SIMPLESEARCH.SEARCH_RESULTS_SUMMARY_SINGULAR"|t(query|e)|raw }} - {% else %} - {{ "PLUGIN_SIMPLESEARCH.SEARCH_RESULTS_SUMMARY_PLURAL"|t(query|e, count)|raw }} - {% endif %} - {% endif %} -

      +
      +

      {{ "PLUGIN_SIMPLESEARCH.SEARCH_RESULTS"|t }}

      +
      + {% include 'partials/simplesearch_searchbox_results.html.twig' %}
      +

      + {% if query %} + {% set count = search_results ? search_results.count : 0 %} + {% if count is same as( 1 ) %} + {{ "PLUGIN_SIMPLESEARCH.SEARCH_RESULTS_SUMMARY_SINGULAR"|t(query|e)|raw }} + {% else %} + {{ "PLUGIN_SIMPLESEARCH.SEARCH_RESULTS_SUMMARY_PLURAL"|t(query|e, count)|raw }} + {% endif %} + {% endif %} +

      +
      {% endblock %} - -
      - +
      - {% for page in search_results %} - {% include 'partials/simplesearch_item.html.twig' with {'page':page} %} + {% for page in search_results %} + {% include 'partials/simplesearch_item.html.twig' with {'page':page} %} {% endfor %} -
      - +
      {% endblock %} + {% block sidebar %} {% if theme_config.sidebar == true %} {% include 'partials/sidebar_left.html.twig' %} From 018bb4c1b6b8d8d30fb50b0756563ebe1afb373e Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 15:42:02 +0100 Subject: [PATCH 26/54] Fix indentation --- future2021.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/future2021.php b/future2021.php index 9a0d142..716bbe3 100644 --- a/future2021.php +++ b/future2021.php @@ -6,7 +6,7 @@ use Grav\Common\Theme; class Future2021 extends Theme { -public function onThemeInitialized() + public function onThemeInitialized() { } From 410152349699b23c1aad7866e91cd2f258390837 Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 15:49:44 +0100 Subject: [PATCH 27/54] Show footer if sidebar is disabled --- templates/blog.html.twig | 6 ++++++ templates/simplesearch_results.html.twig | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/templates/blog.html.twig b/templates/blog.html.twig index e9905f1..dae5a03 100644 --- a/templates/blog.html.twig +++ b/templates/blog.html.twig @@ -52,6 +52,12 @@ {% 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 %} + + {% if theme_config.sidebar == false %} + + {% endif %} {% endblock %} {% block sidebar %} diff --git a/templates/simplesearch_results.html.twig b/templates/simplesearch_results.html.twig index 0d8aa49..ec514fd 100644 --- a/templates/simplesearch_results.html.twig +++ b/templates/simplesearch_results.html.twig @@ -32,6 +32,12 @@ {% include 'partials/simplesearch_item.html.twig' with {'page':page} %} {% endfor %}
      + + {% if theme_config.sidebar == false %} + + {% endif %} {% endblock %} {% block sidebar %} From 2cd5fef0485b40c9492671a98c88144966d59a7d Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 16:15:53 +0100 Subject: [PATCH 28/54] Don't nest image featured class --- templates/partials/blog_item.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/partials/blog_item.html.twig b/templates/partials/blog_item.html.twig index dfc87b1..1a2c22a 100644 --- a/templates/partials/blog_item.html.twig +++ b/templates/partials/blog_item.html.twig @@ -46,9 +46,9 @@ {% if page.header.primaryImage %} - {{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} {% elseif page.media.images %} - {{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} {% endif %}
      From e619c580d9a924f0780f8898021b7a8be9ba1bcd Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 16:36:58 +0100 Subject: [PATCH 29/54] Remove trailing spaces --- templates/forms/fields/privacy/privacy.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/forms/fields/privacy/privacy.html.twig b/templates/forms/fields/privacy/privacy.html.twig index b3b26af..1b6c651 100644 --- a/templates/forms/fields/privacy/privacy.html.twig +++ b/templates/forms/fields/privacy/privacy.html.twig @@ -30,7 +30,7 @@ {% if field.markdown %} {{ field.label|t|markdown(false) }} {% else %} - {{'FUTURE.PRIVACY'|t}} {{field.label}} + {{'FUTURE.PRIVACY'|t}} {{field.label}} {% endif %} {{ field.validate.required in ['on', 'true', 1] ? '*' }} From 00b0b0a5503d73e9b3d4d1ff5970bbf578ad74d1 Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 16:41:01 +0100 Subject: [PATCH 30/54] Remove nested fieldset --- blueprints.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/blueprints.yaml b/blueprints.yaml index 605717e..89650d5 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -83,16 +83,6 @@ form: icon: rss title: FUTURE.ADMIN.THEME.BLOG_DEFAULTS fields: - blog_fields: - type: column - fields: - blog: - type: fieldset - collapsible: true - collapsed: true - icon: rss - title: FUTURE.ADMIN.THEME.BLOG_DEFAULTS - fields: blog_page: type: text From a6adce9e15dc97a56485a913b83180adb9ee39f0 Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 17:56:40 +0100 Subject: [PATCH 31/54] Remove emtpy line --- templates/portfolio.html.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/portfolio.html.twig b/templates/portfolio.html.twig index 803b71f..967fa24 100644 --- a/templates/portfolio.html.twig +++ b/templates/portfolio.html.twig @@ -34,7 +34,6 @@
      {% endfor %} - {% endblock %} From aacdb083ad06af8ffc4a8c9c535ff931edfa367e Mon Sep 17 00:00:00 2001 From: pikim Date: Fri, 20 Jan 2023 17:57:10 +0100 Subject: [PATCH 32/54] Fix extends line as there is no simplesearch_base --- templates/simplesearch_results.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/simplesearch_results.html.twig b/templates/simplesearch_results.html.twig index ec514fd..87e4768 100644 --- a/templates/simplesearch_results.html.twig +++ b/templates/simplesearch_results.html.twig @@ -1,4 +1,4 @@ -{% extends 'partials/simplesearch_base.html.twig' %} +{% extends 'partials/base.html.twig' %} {% block menu %} {% include 'partials/sidebar_right.html.twig' %} From 01bc8e5b6dadd0435460669ac99878ff4c9da56b Mon Sep 17 00:00:00 2001 From: pikim Date: Sun, 22 Jan 2023 20:24:10 +0100 Subject: [PATCH 33/54] Fixed date translation --- templates/formdata.html.twig | 4 ++-- templates/partials/archives.html.twig | 4 ++-- templates/partials/blog_item.html.twig | 4 ++-- templates/partials/miniposts.html.twig | 4 ++-- templates/partials/simplesearch_item.html.twig | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/formdata.html.twig b/templates/formdata.html.twig index 2a07d31..85027b5 100644 --- a/templates/formdata.html.twig +++ b/templates/formdata.html.twig @@ -6,8 +6,8 @@

      {{ form.message }}

      - {% if plugin.translate_date.enabled %} - + {% if config.plugins["translate-date"].enabled %} + {% else %} {% endif %} diff --git a/templates/partials/archives.html.twig b/templates/partials/archives.html.twig index 8d9896b..18321a2 100644 --- a/templates/partials/archives.html.twig +++ b/templates/partials/archives.html.twig @@ -12,8 +12,8 @@

      {{ p.title }}

      - {% if plugin.translate_date.enabled %} - + {% if config.plugins["translate-date"].enabled %} + {% else %} {% endif %} diff --git a/templates/partials/blog_item.html.twig b/templates/partials/blog_item.html.twig index 1a2c22a..9308f4c 100644 --- a/templates/partials/blog_item.html.twig +++ b/templates/partials/blog_item.html.twig @@ -31,8 +31,8 @@ {% endif %}
      - {% if plugin.translate_date.enabled %} - + {% if config.plugins["translate-date"].enabled %} + {% else %} {% endif %} diff --git a/templates/partials/miniposts.html.twig b/templates/partials/miniposts.html.twig index d70dd2f..9c104c5 100644 --- a/templates/partials/miniposts.html.twig +++ b/templates/partials/miniposts.html.twig @@ -12,8 +12,8 @@

      {{ p.title }}

      - {% if plugin.translate_date.enabled %} - + {% if config.plugins["translate-date"].enabled %} + {% else %} {% endif %} diff --git a/templates/partials/simplesearch_item.html.twig b/templates/partials/simplesearch_item.html.twig index d51658f..ba32d0a 100644 --- a/templates/partials/simplesearch_item.html.twig +++ b/templates/partials/simplesearch_item.html.twig @@ -12,7 +12,7 @@
      - {% if plugin.translate_date.enabled %} + {% if config.plugins["translate-date"].enabled %} {{ page.date|td(null, config.system.pages.dateformat.short) }} {% else %} {{ page.date|date(config.system.pages.dateformat.short) }} From 6561dc788ecb6e6d84014b34402014314f2d4362 Mon Sep 17 00:00:00 2001 From: pikim Date: Wed, 1 Feb 2023 22:04:36 +0100 Subject: [PATCH 34/54] Merge latest changes from initial develop --- templates/partials/blog_item.html.twig | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/templates/partials/blog_item.html.twig b/templates/partials/blog_item.html.twig index 9308f4c..93be1cb 100644 --- a/templates/partials/blog_item.html.twig +++ b/templates/partials/blog_item.html.twig @@ -5,12 +5,10 @@ {% elseif page.header.author %} {% set author = page.header.author %} {% else %} - {% set author = page.header.taxonomy.author[0] %} + {% set author = page.taxonomy.author[0] %} {% endif %} - {% if author %} - {% set avatar = author|replace(' ', '-')|lower %} - {% endif %} + {% set avatar = page.media[page.header.avatarImage].url|e %}
      @@ -37,9 +35,10 @@ {% endif %} {% if author %} - {{ tag }} - {% if page.header.avatarImage %}{{ author }} - {% endif %} + {% endif %}
      From ff9999d31c2a998a02970c36d441fe3efaae1b00 Mon Sep 17 00:00:00 2001 From: pikim Date: Wed, 1 Feb 2023 22:06:52 +0100 Subject: [PATCH 35/54] Remove whitespace --- templates/partials/blog_item.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/partials/blog_item.html.twig b/templates/partials/blog_item.html.twig index 93be1cb..d6ea18c 100644 --- a/templates/partials/blog_item.html.twig +++ b/templates/partials/blog_item.html.twig @@ -35,7 +35,7 @@ {% endif %} {% if author %} -
    - {% if page.header.image %} + {% if image %} - {{page.media[page.header.image].loading('lazy').html('',page.title)|raw}} - - {% else %} - - {{page.media[page.header.primaryImage].loading('lazy').html('',page.title)|raw}} + {{image.loading('lazy').html(title,title)|raw}} {% endif %} From 72440d8d27fb9fd9e3fe351f1fa8ceafbcd73b88 Mon Sep 17 00:00:00 2001 From: "pmoreno.rodriguez" <60596353+pmoreno-rodriguez@users.noreply.github.com> Date: Fri, 3 Feb 2023 22:58:13 +0100 Subject: [PATCH 48/54] Improved the definition of variables. Improved the definition of title, subtitle and image variables. Added the featured image, subtitle and content --- templates/modular/features.html.twig | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/templates/modular/features.html.twig b/templates/modular/features.html.twig index a45bd20..f29c7e7 100644 --- a/templates/modular/features.html.twig +++ b/templates/modular/features.html.twig @@ -1,13 +1,21 @@ +{% set image = page.media[page.header.primaryImage] ?: page.media.images|first %} +{% set title = page.title|raw %} +{% set subtitle = page.header.subtitle|raw %} {% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %}
    -

    {{ page.title }}

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

    {{ page.header.subtitle }}

    +

    {{ title }}

    + {% if subtitle %} +

    {{ subtitle }}

    {% endif %}
    - {{ content|raw }} + + {% if image %} + {{ image.cropZoom(1038,437).loading('lazy').html(title, title, 'image featured')|raw }} + {% endif %} + + {{ page.content|raw }}
    {% for feature in page.header.features %} From 43b0da2882b0ccfabcbb70f261aa8d6b2eed752c Mon Sep 17 00:00:00 2001 From: "pmoreno.rodriguez" <60596353+pmoreno-rodriguez@users.noreply.github.com> Date: Fri, 3 Feb 2023 23:10:09 +0100 Subject: [PATCH 49/54] Improved the definition of variables. Improved the definition of title, subtitle and image variables. --- templates/partials/archives.html.twig | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/templates/partials/archives.html.twig b/templates/partials/archives.html.twig index 18321a2..99a3215 100644 --- a/templates/partials/archives.html.twig +++ b/templates/partials/archives.html.twig @@ -1,16 +1,13 @@
      {% for p in page.find(theme_config.blog_page).children.order('date', 'desc').slice(0, 5) %} - {% if p.header.primaryImage %} - {% set bannerimage = p.media[p.header.primaryImage]%} - {% else %} - {% set bannerimage = p.media.images|first %} - {% endif %} + {% set image = p.media[p.header.primaryImage] ?: p.media.images|first %} + {% set title = p.title|raw %}
    • From 17c977eeb921757f8a84e63362fe941326a1595c Mon Sep 17 00:00:00 2001 From: "pmoreno.rodriguez" <60596353+pmoreno-rodriguez@users.noreply.github.com> Date: Fri, 3 Feb 2023 23:19:04 +0100 Subject: [PATCH 50/54] Improved the definition of variables. Improved the definition of title, subtitle and image variables. --- templates/partials/miniposts.html.twig | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/templates/partials/miniposts.html.twig b/templates/partials/miniposts.html.twig index 9c104c5..6a18f91 100644 --- a/templates/partials/miniposts.html.twig +++ b/templates/partials/miniposts.html.twig @@ -1,5 +1,6 @@ {% set miniposts_category = theme_var('miniposts_category') %} {% set miniposts_number = config.theme.miniposts_number %} +{% set lang = grav.language.getActive ?: grav.config.site.default_lang %}
      @@ -7,25 +8,29 @@
      {% for p in page.evaluate({'@taxonomy.category':miniposts_category}).order('header.order', 'asc').slice(0,miniposts_number) %} + {% set image = p.media[p.header.primaryImage] ?: p.media.images|first %} + {% set title = p.title|raw %}

      {{ p.title }}

      {% if config.plugins["translate-date"].enabled %} - + + {% elseif config.plugins["twig-extensions"].enabled %} + {% else %} - + {% endif %} + {% if avatar %} + {% endif %}
      + {% if image %} - {% if p.header.primaryImage %} - {{ p.media[p.header.primaryImage].cropZoom(1038,437).loading('lazy').html('',p.title)|raw}} - {% else %} - {{p.media.images|first.cropZoom(1038,437).loading('lazy').html('',p.title)|raw}} - {% endif %} + {{ image.cropZoom(1038,437).loading('lazy').html(title,title)|raw}} + {% endif %}
      {% endfor %}
      From 7bcd5189b0c07767d704197f1e63d98f21b88167 Mon Sep 17 00:00:00 2001 From: "pmoreno.rodriguez" <60596353+pmoreno-rodriguez@users.noreply.github.com> Date: Fri, 3 Feb 2023 23:24:24 +0100 Subject: [PATCH 51/54] Improved the definition of variables. Improved the definition of title, subtitle and image variables. --- templates/portfolio.html.twig | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/portfolio.html.twig b/templates/portfolio.html.twig index 967fa24..acd5b9b 100644 --- a/templates/portfolio.html.twig +++ b/templates/portfolio.html.twig @@ -1,5 +1,7 @@ {% extends 'partials/base.html.twig' %} - +{% set image = page.media[page.header.primaryImage] %} +{% set title = page.title|raw %} +{% set subtitle = page.header.subtitle|raw %} {% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %} {% block menu %} @@ -11,14 +13,14 @@
      -

      {{ page.header.title }}

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

      {{ page.header.subtitle }}

      +

      {{ title }}

      + {% if subtitle %} +

      {{ subtitle }}

      {% endif %}
      - {% if page.header.primaryImage %} - {{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {% if image %} + {{ image.cropZoom(1038,437).loading('lazy').html(title, title, 'image featured')|raw }} {% endif %} {{ page.content|raw}} From ca381944f8767788abcde28cf08fd58e0740f25c Mon Sep 17 00:00:00 2001 From: "pmoreno.rodriguez" <60596353+pmoreno-rodriguez@users.noreply.github.com> Date: Sat, 4 Feb 2023 12:47:33 +0100 Subject: [PATCH 52/54] Deleted width and height in search-image Width and Height is already defined with cropZoom(100,100) filter in search results template. --- assets/css/misc.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/assets/css/misc.css b/assets/css/misc.css index a39a7a3..622637f 100644 --- a/assets/css/misc.css +++ b/assets/css/misc.css @@ -70,8 +70,6 @@ } .search-image img { overflow:hidden; - width: 100px; - height: 100px; object-fit: cover; object-position: 0 100%; } From 7132d7557046a961f0cbff026271fbeda30a7015 Mon Sep 17 00:00:00 2001 From: "pmoreno.rodriguez" <60596353+pmoreno-rodriguez@users.noreply.github.com> Date: Sat, 4 Feb 2023 22:31:16 +0100 Subject: [PATCH 53/54] Deleted
      and rename banner to thumb --- templates/partials/simplesearch_item.html.twig | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/templates/partials/simplesearch_item.html.twig b/templates/partials/simplesearch_item.html.twig index 0e392e9..67de9ba 100644 --- a/templates/partials/simplesearch_item.html.twig +++ b/templates/partials/simplesearch_item.html.twig @@ -1,24 +1,21 @@
      {% set title = page.title %} - {% set banner = page.media[page.header.primaryImage] ?: page.media.images|first %} + {% set thumb = page.media[page.header.primaryImage] ?: page.media.images|first %} - {% if banner %} + {% if thumb %} {% endif %}
      -
      {{ page.date|date(config.system.pages.dateformat.short) }}
      - -

      {{ page.summary|truncate(200)|raw }}

      - -
      +

      {{ page.summary|truncate(200)|raw }}

      +
      From dc06785635fb7f09cc52599c49e34abaa3053969 Mon Sep 17 00:00:00 2001 From: "pmoreno.rodriguez" <60596353+pmoreno-rodriguez@users.noreply.github.com> Date: Sat, 4 Feb 2023 22:35:08 +0100 Subject: [PATCH 54/54] Updated search-item class Deleted border-bottom from image link in search-item and deleted width and height --- assets/css/misc.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/css/misc.css b/assets/css/misc.css index 622637f..74f9c84 100644 --- a/assets/css/misc.css +++ b/assets/css/misc.css @@ -64,7 +64,6 @@ /* Styles to support svg images in search results */ .search-row { - border-bottom: none; display: flex; align-items: top; } @@ -73,15 +72,20 @@ object-fit: cover; object-position: 0 100%; } +.search-image a { + border-bottom: none; +} @media only all and (max-width: 47.938em) { .search-image img {display:none;} } .search-item { margin-left: 30px; margin-bottom: 50px; + border-bottom: solid 1px rgba(160, 160, 160, 0.3); + padding-bottom: 2em; } -/* Modified styles from Breadcrumbs */ +/* Styles modified from Breadcrumbs */ #breadcrumbs { padding-inline-start: 0rem;