From c54251ca7ab6f715ceacba7ed6406df683aa364b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar?= Date: Sun, 19 May 2024 20:36:38 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(homepage):=20allow=20hiding=20?= =?UTF-8?q?posts=20listing=20(#317)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/partials/main_page_posts_list.html | 32 +++++++++++--------- templates/section.html | 6 +++- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/templates/partials/main_page_posts_list.html b/templates/partials/main_page_posts_list.html index 3c138a7..0d62f03 100644 --- a/templates/partials/main_page_posts_list.html +++ b/templates/partials/main_page_posts_list.html @@ -1,18 +1,20 @@ -
-
- {{ macros_page_header::page_header(title=section.title) }} -
+{%- if paginator or extra_section -%} +
+
+ {{ macros_page_header::page_header(title=section.title) }} +
- {%- if paginator %} - {%- set pages = paginator.pages -%} - {% else %} - {%- set pages = extra_section.pages -%} - {% endif -%} + {%- if paginator %} + {%- set pages = paginator.pages -%} + {% else %} + {%- set pages = extra_section.pages -%} + {% endif -%} - {% set max_posts = section.extra.max_posts | default(value=999999) %} - {{ macros_list_posts::list_posts(posts=pages, max=max_posts, language_strings=language_strings, section_path=path) }} -
+ {% set max_posts = section.extra.max_posts | default(value=999999) %} + {{ macros_list_posts::list_posts(posts=pages, max=max_posts, language_strings=language_strings, section_path=path) }} +
-{% if paginator %} - {%- include "partials/paginate.html" -%} -{% endif %} + {% if paginator %} + {%- include "partials/paginate.html" -%} + {% endif %} +{%- endif -%} diff --git a/templates/section.html b/templates/section.html index 7fda406..34802c6 100644 --- a/templates/section.html +++ b/templates/section.html @@ -9,7 +9,11 @@ {%- set first_section = "posts" -%} {%- endif -%} -
+{%- if section.extra.section_path or paginator and projects_path -%} + {%- set more_than_one_section_shown = true -%} +{%- endif -%} + +
{%- if section.extra.header %} {%- include "partials/home_banner.html" -%} {% endif -%}