<section id="gancio">
  <div class="section-headers">
    <h2>Agenda</h2>
    <h4>𝕺𝖚𝖙𝖊𝖗𝖓𝖆𝖙𝖎𝖔𝖓𝖆𝖑 𝕰𝖛𝖊𝖓𝖙𝖘</h4>
    <p>Through the power of federation, we aggregate event data from the deep-web to keep you in the loop of what's happening below the radars.</p>
    <p>Want your event featured here? <a href="https://do.basspistol.org/add" target="_blank" style="text-decoration: underline;">Head over to this page</a>. No account required.</p>
    <a class="button" href="https://do.basspistol.org/">Full agenda 🗓️</a>
  </div>

 {{ $data := dict }}
  {{ $url := "https://do.basspistol.org/api/events" }}

     {{ with try (resources.GetRemote $url) }}
    {{ with .Err }}
      {{ errorf "%s" . }}
    {{ else with .Value }}
      {{ $data = .Content | transform.Unmarshal }}
    {{ else }}
      {{ errorf "Unable to get remote resource %q" $url }}
    {{ end }}
  {{ end }}

  {{ with $data }}
  {{ range . | first 4 }}

    <article>

        <figure>
                <a href="https://do.basspistol.org/event/{{ .slug }}" target="_blank">{{ range .media }}<img src="https://do.basspistol.org/media/thumb/{{ .url }}" />{{ end }}</a>
          <figcaption>

            <h4>{{ .title }}</h4>
            <time datetime="{{ .start_datetime | int | dateFormat "2006-01-02T15:04" }}">{{ .start_datetime | int | dateFormat "2006-01-02 15:04 UTC" }}</time>
            <p><b>Venue:</b> {{ .place.name }}</p>
            <p><b>Address: </b>{{ .place.address }}</p>
            <!--    <p>{{ range .tags }}#{{ . }} {{ end }}</p>-->
          </figcaption>
        </figure>

    </article>


  {{ end }}
<!--  <pre>{{ debug.Dump $data }}</pre>-->
  {{ end }}


  <div class="section-footers"></div>
</section>
