Ctrl K
ComunidadGuías…

docs/_includes/hub.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 activeHub = urlParts[3] %}

{% assign platform = site.data.routes.platforms | where: "href", activePlatform | first %}

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

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

<p>{{ hub.description }}</p>

{% assign emptyItems = "" | split: "," %}
{% assign hubArticles = hub.articles | default: emptyItems %}
{% assign hubSections = hub.sections | default: emptyItems %}

{% if hub.articles %}
    {% assign sortedSectionsAndArticles = hubSections | concat: hubArticles | sort: 'order' %}
{% else %}
    {% assign sortedSectionsAndArticles = hubSections | sort: 'order' %}
{% endif%}

<section>
    <div class="cards-group">
        {% for item in sortedSectionsAndArticles %}
            {% if item.articles or item.sections %}
                {% include section-card.html platform=activePlatform hub=hub.href section=item.href title=item.title %}
            {% else %}
                {% include article-card.html hub=hub.href href=item.href title=item.title platform=activePlatform %}
            {% endif %}
        {% endfor %}
    </div>
</section>