Skip to content
Snippets Groups Projects
site-feature.html 2.19 KiB
{% assign feature_text = page.feature_text -%}
{% assign feature_image = page.feature_image -%}

{% if page.layout == "project" -%}
  {% if feature_image == nil or feature_image == '' -%}
    {% assign feature_image = page.image -%}
  {% endif -%}
{% endif -%}

{% if feature_image == nil or feature_image == '' -%}
  {% assign feature_image = page.image -%}
{% endif -%}

{% if feature_image == nil or feature_image == '' -%}
  {% assign feature_image = site.feature_image -%}
{% endif -%}

{% if feature_image == "/assets/default-social-image.jpg" -%}
  {% assign feature_image = site.feature_image -%}
{% endif %}

{% if page.collectionpage -%}
  {% assign collectiondata = site.collections | where: "label", page.collectionpage | first -%}
  {% assign feature_text = collectiondata.feature_text -%}
  {% assign feature_image = collectiondata.feature_image -%}
{% endif -%}

{% if page.layout == "video" -%}
  {%- assign realslug = page.url | split:'/' | last -%}
  {% capture feature_image %}https://video.chaotikum.net/thumbnails/share/{{realslug}}_share.png{% endcapture -%}
  {% capture image %}https://video.chaotikum.net/thumbnails/{{realslug}}.jpg{% endcapture -%}
{% endif -%}

{% if nofeature %}

{% else %}
  {% if page.layout == "video" -%}

  {% else %}
    {% if feature_text or feature_image -%}
      {% if feature_image contains 'http' -%}
        <div class="feature"{% if feature_image %} style="background-image: url({{ feature_image }})"{% endif %}>
            <div class="container  typeset">
              {{ feature_text | markdownify }}
            </div>
        </div>
      {% else -%}
        <div class="feature"{% if feature_image %} style="background-image: url({{site.baseurl}}{{ feature_image }})"{% endif %}>
            <div class="container  typeset">
              {{ feature_text | markdownify }}
            </div>
        </div>
      {% endif -%}
    {% else -%}
    {% assign feature_image = site.default-feature -%}
    <div class="feature"{% if feature_image %} style="background-image: url({{site.baseurl}}{{ feature_image }})"{% endif %}>
      <div class="container  typeset">
        {{ feature_text | markdownify }}
      </div>
    </div>
    {% endif -%}
  {% endif -%}
{% endif -%}