{% load wagtailcore_tags core_tags wagtailimages_tags gem_tags %}

    {% for section in sections %}
      {% if section %}

        {% if section|is_content:"News" %}
          {% load_descendant_articles_for_section section featured_in_homepage=True as articles %}
          {% if articles %}
            <div class="article-teaser article-teaser--general">
              <div class="heading heading--general-featured">
                <h1 class=" heading__component">
                  {% trans "Yegna news" %}
                </h1>
              </div>
              <div class="article-teaser__wrapper">
                <ul class="teaser-stacklist">
                  {% for article in articles %}
                    <li class="teaser-stacklist__item">
                      {% if article.get_effective_image %}
                      <div class="teaser-stacklist__images">
                        <a href="{% pageurl article.specific %}" class="teaser-stacklist__anchor">
                          {% image article.get_effective_image width-1080 format-jpeg as teaser_thumbnail %}
                          <img alt="{{ article.title }}" src="{{ teaser_thumbnail.url }}" class="teaser-stacklist__thumbnail" />
                        </a>
                      </div>
                      {% endif %}
                      <div class="teaser-stacklist__container">
                        {% load_tags_for_article article as tags %}
                        {% if tags %}
                        <ul class="teaser-tags">
                          {% if settings.core.SiteSettings.enable_tag_navigation %}
                            {% for tag in tags %}
                              {% if not tag.title.20 %}
                                <li class="teaser-tags__item">
                                  <a href="{% url 'tags_list' tag.slug %}" class="teaser-tags__anchor">
                                    <span class="teaser-tags__title">{{ tag.title }}</span>
                                  </a>
                                </li>
                              {% endif %}
                            {% endfor %}
                          {% elif settings.core.SiteSettings.enable_clickable_tags %}
                            {% for tag in article.tags_list %}
                              <li class="teaser-tags__item">
                                <span class="teaser-tags__title">{{tag}}</span>
                              </li>
                            {% endfor %}
                          {% endif %}
                        </ul>
                        {% endif %}
                        <a href="{% pageurl article.specific %}" class="teaser-stacklist__anchor">
                          <h1 class="teaser-stacklist__title {% if article.title_highlight %}teaser-stacklist__title--highlight{% endif %}">
                            {% if article.title_highlight %}
                              {{ article.title_highlight|smarttruncatechars:100|safe}}
                            {% else %}
                              {{ article.title|safe}}
                            {% endif %}
                          </h1>
                        </a>
                        {% if article.subtitle_highlight or article.body_highlight %}
                          <p class="teaser-stacklist__subtitle">
                            {% if article.subtitle_highlight %}
                              {{article.subtitle_highlight|smarttruncatechars:150|safe}}
                            {% elif article.body_highlight %}
                              {{article.body_highlight|smarttruncatechars:150|safe}}
                            {% endif %}
                          </p>
                        {% elif article.subtitle %}
                          <p class="teaser-stacklist__subtitle">
                            {{ article.subtitle|smarttruncatechars:150|safe}}
                          </p>
                        {% endif %}
                        </div>
                      </li>
                    {% endfor %}
                </ul>
                <a class="call-to-action__item call-to-action__item--paginate" href="{% pageurl section %}">
                  {% trans "View all" %}
                </a>
              </div>
            </div>
          {% endif %}
        {% endif %}
      {% endif %}
    {% endfor %}
  </div>
    {% for section in sections %}
      {% if section %}

        {% if section|is_content:"Cast" %}
          <div class="landing-page__second-column">
            {% load_descendant_articles_for_section section featured_in_homepage=True as articles %}
            {% if articles %}
                <div class="article-teaser article-teaser--sidebar">
                  <div class="heading heading--sidebar heading--sidebar-featured">
                    <h1 class="heading__component">
                      <span class="heading__component--inner">{% trans "Meet the characters" %}</span>
                    </h1>
                  </div>
                  <div class="article-teaser__wrapper">
                    <ul class="teaser-grid">
                      {% for article in articles %}
                        <li class="teaser-grid__item">
                          {% if article.get_effective_image %}
                          <div class="teaser-grid__images">
                            <a href="{% pageurl article.specific %}" class="teaser-grid__anchor">
                              {% image article.get_effective_image width-1080 format-jpeg as teaser_thumbnail %}
                              <img alt="{{ article.title }}" src="{{ teaser_thumbnail.url }}" class="teaser-grid__thumbnail" />
                            </a>
                          </div>
                          {% endif %}
                          <div class="teaser-grid__container">
                            {% load_tags_for_article article as tags %}
                            {% if tags %}
                            <ul class="teaser-tags">
                              {% if settings.core.SiteSettings.enable_tag_navigation %}
                                {% for tag in tags %}
                                  {% if not tag.title.20 %}
                                    <li class="teaser-tags__item">
                                      <a href="{% url 'tags_list' tag.slug %}" class="teaser-tags__anchor">
                                        <span class="teaser-tags__title">{{ tag.title }}</span>
                                      </a>
                                    </li>
                                  {% endif %}
                                {% endfor %}
                              {% elif settings.core.SiteSettings.enable_clickable_tags %}
                                {% for tag in article.tags_list %}
                                  <li class="teaser-tags__item">
                                    <span class="teaser-tags__title">{{tag}}</span>
                                  </li>
                                {% endfor %}
                              {% endif %}
                            </ul>
                            {% endif %}
                            <a href="{% pageurl article.specific %}" class="teaser-stacklist__anchor">
                              <h1 class="teaser-grid__title {% if article.title_highlight %}teaser-grid__title--highlight{% endif %}">
                                {% if article.title_highlight %}
                                  {{ article.title_highlight|smarttruncatechars:100|safe}}
                                {% else %}
                                  {{ article.title|safe}}
                                {% endif %}
                              </h1>
                            </a>
                            {% if article.subtitle_highlight or article.body_highlight %}
                              <p class="teaser-grid__subtitle">
                                {% if article.subtitle_highlight %}
                                  {{article.subtitle_highlight|smarttruncatechars:150|safe}}
                                {% elif article.body_highlight %}
                                  {{article.body_highlight|smarttruncatechars:150|safe}}
                                {% endif %}
                              </p>
                            {% elif article.subtitle %}
                              <p class="teaser-grid__subtitle">
                                {{ article.subtitle|smarttruncatechars:150|safe}}
                              </p>
                            {% endif %}
                              <a class="call-to-action__item call-to-action__item--text" href="{% pageurl article.specific %}">
                                {% trans "Read more" %}
                              </a>
                            </div>
                          </li>
                        {% endfor %}
                    </ul>
                    <a class="call-to-action__item call-to-action__item--paginate" href="{% pageurl section %}">
                      {% trans "View all" %}
                    </a>
                  </div>
                </div>
            {% endif %}
          </div>
        {% endif %}
      {% endif %}
    {% endfor %}
