feat: allow showcasing featured projects on homepage (#297)

This commit is contained in:
Óscar
2024-04-23 17:59:35 +02:00
committed by GitHub
parent 7ef74a8f53
commit e7172a0432
28 changed files with 174 additions and 26 deletions

View File

@@ -0,0 +1,17 @@
{% if section.extra.projects_path %}
{%- set projects_section = get_section(path=section.extra.projects_path) -%}
{%- if projects_section -%}
<div id="featured-projects" class="list">
{{ macros_page_header::page_header(title=macros_translate::translate(key="featured_projects", default="Featured projects", language_strings=language_strings)) }}
</div>
{%- set show_pages = projects_section.pages -%}
{%- set max_projects = section.extra.max_projects | default(value=3) -%}
{%- include "partials/cards_pages.html" -%}
{%- endif -%}
{%- if show_pages | length > max_projects -%}
<div class="all-posts {{ first_section }}-first" id="all-projects">
<a href="{{ get_url(path=projects_section.path, lang=lang) }}/">{{ macros_translate::translate(key="all_projects", default="All projects", language_strings=language_strings) }}&nbsp;<span class="arrow"></span></a>
</div>
{%- endif -%}
</div>
{% endif %}