Ctrl K
ComunidadGuías…

docs/_includes/section.html

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
{% assign urlParts = page.url | split: '/' %}
{% assign activePlatform = urlParts[1] %}
{% assign platform = site.data.routes.platforms | where: "href", activePlatform | first %}

{% assign activeHub = urlParts[3] %}
{% assign hub = platform.hubs | where: "href", activeHub | first %}

{% assign hubPrefix = "/" | append: activePlatform | append: "/hubs/" | append: activeHub | append: "/" %}
{% assign activeSectionPath = page.url | replace: ".html", "" | replace: hubPrefix, "" %}

{% assign section = hub.flatSections | where: "href", activeSectionPath | first %}

<h1 class="title">
    {{ section.title }}
</h1>

<section>
    <div class="cards-group">
        {% if section.sections %}
            {% assign sortedSubsections = section.sections | sort: 'order' %}
            {% for subsection in sortedSubsections %}
                {% include section-card.html platform=activePlatform hub=hub.href section=subsection.href title=subsection.title %}
            {% endfor %}
        {% endif %}
        {% assign emptyItems = "" | split: "," %}
        {% assign sortedArticles = section.articles | default: emptyItems %}
        {% for article in sortedArticles %}
            {% assign article_href = section.href | append: '/' | append: article.href %}
            {% include article-card.html hub=hub.href href=article_href title=article.title platform=activePlatform %}
        {% endfor %}
    </div>
</section>