From a2ea06d513a5802964f8f0ef5795cec7e548ed7b Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sat, 13 Sep 2025 14:55:15 -0600 Subject: Squashed 'themes/tabi-lean/' content from commit 95c8796 git-subtree-dir: themes/tabi-lean git-subtree-split: 95c879696445ede40daa7a30a88dae5dd74d5c0c --- templates/partials/main_page_posts_list.html | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 templates/partials/main_page_posts_list.html (limited to 'templates/partials/main_page_posts_list.html') diff --git a/templates/partials/main_page_posts_list.html b/templates/partials/main_page_posts_list.html new file mode 100644 index 0000000..067e178 --- /dev/null +++ b/templates/partials/main_page_posts_list.html @@ -0,0 +1,61 @@ +{%- if paginator or extra_section -%} +
+
+ {{ macros_page_header::page_header(title=section.title) }} +
+ + {# Check if both paginate_by and section_path are set #} + {%- set both_settings_set = paginator and extra_section -%} + {%- set paginator_has_no_pages = paginator and paginator.pages | length == 0 -%} + {%- set extra_section_has_pages = extra_section and extra_section.pages | length > 0 -%} + + {# Display warning if both settings are set #} + {%- if both_settings_set and paginator_has_no_pages and extra_section_has_pages -%} +
+
+
+ WARNING: Conflicting Configuration +

+ No posts are displayed due to conflicting settings in your _index.md: +

+
    +
  • paginate_by is set, but there are no posts to paginate in the current section.
  • +
  • section_path is set, and posts are available in that section.
  • +
+

+ Solution: Remove paginate_by from your _index.md. + To limit the number of displayed posts, use max_posts in the [extra] section instead. +

+
+
+ {%- endif -%} + + {# Get all posts for pinning if we're in root section with pagination #} + {%- if paginator and is_root_section -%} + {%- set root_section = get_section(path="_index.md") -%} + {%- set all_posts = root_section.pages -%} + {%- set pages = paginator.pages -%} + {%- elif paginator -%} + {%- set all_posts = paginator.pages -%} + {%- set pages = paginator.pages -%} + {%- else -%} + {%- set all_posts = extra_section.pages -%} + {%- set pages = extra_section.pages -%} + {%- endif -%} + + {% set max_posts = section.extra.max_posts | default(value=999999) %} + {{ macros_list_posts::list_posts( + posts=pages, + all_posts=all_posts, + max=max_posts, + language_strings=language_strings, + section_path=extra_section.path | default(value="blog"), + pinned_first=is_root_section, + current_page=paginator.current_index | default(value=1) + ) }} +
+ + {% if paginator and paginator.pages | length > 0 %} + {%- include "partials/paginate.html" -%} + {% endif %} +{%- endif -%} -- cgit v1.2.3