Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat(homepage): allow hiding posts listing #317

Merged
merged 1 commit into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions templates/partials/main_page_posts_list.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<div id="posts-list">
<div>
{{ macros_page_header::page_header(title=section.title) }}
</div>
{%- if paginator or extra_section -%}
<div id="posts-list">
<div>
{{ macros_page_header::page_header(title=section.title) }}
</div>

{%- 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) }}
</div>
{% 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) }}
</div>

{% if paginator %}
{%- include "partials/paginate.html" -%}
{% endif %}
{% if paginator %}
{%- include "partials/paginate.html" -%}
{% endif %}
{%- endif -%}
6 changes: 5 additions & 1 deletion templates/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
{%- set first_section = "posts" -%}
{%- endif -%}

<main class={{ first_section }}-first>
{%- if section.extra.section_path or paginator and projects_path -%}
{%- set more_than_one_section_shown = true -%}
{%- endif -%}

<main {% if more_than_one_section_shown %}class="{{ first_section }}-first"{% endif %}>
{%- if section.extra.header %}
{%- include "partials/home_banner.html" -%}
{% endif -%}
Expand Down