mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
- Homepage builder now renders footer section below main content - Sidebar supports custom-html widget type with title + content - New homepage-footer.njk component for footer items Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
87 lines
2.5 KiB
Plaintext
87 lines
2.5 KiB
Plaintext
{#
|
|
Homepage Builder - renders configured layout, sections, and sidebar
|
|
from homepageConfig (written by indiekit-endpoint-homepage plugin)
|
|
#}
|
|
|
|
{% set layout = homepageConfig.layout or "two-column" %}
|
|
{% set hasSidebar = homepageConfig.sidebar and homepageConfig.sidebar.length %}
|
|
|
|
{# Hero — rendered before layout wrapper when enabled #}
|
|
{% if homepageConfig.hero and homepageConfig.hero.enabled %}
|
|
{% include "components/sections/hero.njk" %}
|
|
{% endif %}
|
|
|
|
{# Layout wrapper #}
|
|
{% if layout == "single-column" %}
|
|
|
|
{# Single column — no sidebar, full width sections #}
|
|
<div class="homepage-sections">
|
|
{% for section in homepageConfig.sections %}
|
|
{% if section.type != "hero" %}
|
|
{% include "components/homepage-section.njk" %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% elif layout == "two-column" and hasSidebar %}
|
|
|
|
{# Two column — sections + sidebar #}
|
|
<div class="layout-with-sidebar">
|
|
<div class="main-content">
|
|
<div class="homepage-sections">
|
|
{% for section in homepageConfig.sections %}
|
|
{% if section.type != "hero" %}
|
|
{% include "components/homepage-section.njk" %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
<aside class="sidebar" data-pagefind-ignore>
|
|
{% include "components/homepage-sidebar.njk" %}
|
|
</aside>
|
|
</div>
|
|
|
|
{% elif layout == "full-width-hero" %}
|
|
|
|
{# Full width hero (already rendered above), then two-column below #}
|
|
{% if hasSidebar %}
|
|
<div class="layout-with-sidebar">
|
|
<div class="main-content">
|
|
<div class="homepage-sections">
|
|
{% for section in homepageConfig.sections %}
|
|
{% if section.type != "hero" %}
|
|
{% include "components/homepage-section.njk" %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
<aside class="sidebar" data-pagefind-ignore>
|
|
{% include "components/homepage-sidebar.njk" %}
|
|
</aside>
|
|
</div>
|
|
{% else %}
|
|
<div class="homepage-sections">
|
|
{% for section in homepageConfig.sections %}
|
|
{% if section.type != "hero" %}
|
|
{% include "components/homepage-section.njk" %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
{# Fallback — two-column without sidebar, or unknown layout #}
|
|
<div class="homepage-sections">
|
|
{% for section in homepageConfig.sections %}
|
|
{% if section.type != "hero" %}
|
|
{% include "components/homepage-section.njk" %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{# Footer — rendered after the main layout, full width #}
|
|
{% include "components/homepage-footer.njk" %}
|