<!-- BEGIN hero.html -->
<div id="banner" style={% if page.url == "/" %}"height:100%"{% else %}"height:60%; background-image:url('{{ page.image }}');background-size:cover;background-position:center;"{% endif %}>

  <div>
    <a href="{{ site.baseurl }}/" class="nodecoration"><img
        src="{{ site.baseurl }}/assets/img/logo%20galleri%20momangen.svg" alt="{{ site.title }}" title="{{ site.title }}" /></a>
    {% if page.url == "/" %}
    <div id="poster">
      <!-- Begin Up next -->
      {% capture now -%}{{ site.time | date: '%s' }}{%- endcapture %}
      {% for event in site.events %}
      {% capture endtime -%}
      {{ event.event_data.end_datetime | date: '%s' }}
      {%- endcapture %}
      {% if now <= endtime %}
      <div>
        <p>På gång:</p>
        <a href="cloudcannon:collections/{{ event.path }}" class="editor-link cms-editor-link">Redigera Event</a>
        <h2><a href="{{ event.url }}" class="nodecoration">{{ event.title }}</a></h2>
        <p>
          {% assign d = event.event_data.start_datetime | date: "%-d"  %}{% case d %}{% when '1' or '21' or '31' or '2' or '22' %}{{ d }}:a
          {% else %}{{ d }}:e{% endcase %}
          {% assign m = event.event_data.start_datetime | date: "%-m" %}
          {% case m %}
          {% when '1' %}Januar
          {% when '2' %}Februar
          {% when '3' %}Mars
          {% when '4' %}April
          {% when '5' %}Maj
          {% when '6' %}Juni
          {% when '7' %}Juli
          {% when '8' %}Augusti
          {% when '9' %}September
          {% when '10' %}October
          {% when '11' %}November
          {% when '12' %}December
          {% endcase %}
          {{ event.event_data.start_datetime | date: "%Y" }}
          kl. {{ event.event_data.start_datetime | date: "%R"}}<br />
          Typ av konst: {{ event.category }}</p>
        <h3>{{ event.description | truncatewords: 10 }} </h3>
        <p><a class="cta" href="{{ event.url }}" style="padding:10px;"> Läs mer </a></p>
      </div>
      {% break %}
      {% endif %}
      {% endfor %}
      <!-- end Up next-->
    </div>
    {% else %}{% endif %}
  </div>
</div>
<!-- END hero.html -->