{%- 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 a warning if both settings are set, paginator has no pages, but extra section does #} {%- 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 -%} {%- 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) }}
{% if paginator and paginator.pages | length > 0 %} {%- include "partials/paginate.html" -%} {% endif %} {%- endif -%}