25/lib/mse25_web/controllers/page_html/events.html.heex
Anders Englöf Ytterström 57e935ec00
Improve HTML for robot consumtion (#24)
* Fix icalendar validation errors

* Add RSS feed to documents

* Add stuff to meta: opengraph, canonical

* Add SEO robots meta elements

* Fix correct page titles

* Add more semantics to HTML

* Remove breadcrumbs from templates

* Render breadcrumbs in layout

Each controller should provide their own breadcrumb
trail as a list of tuples, where each tuple is the
pair of a slugified key and a human readable label.

Example:

[{"blog", "Webblogg"}]
[{"blog", "Webblogg"}, "2024", "2024"]

* Add CSS util class to show content only to screen readers

* Load interactive event map only on events page

* Decrease home logo size

* Use correct HTML element for time

* Improve Home page HTML semantics

* Add Person RFDa to footer

* Add RDFa to articles: annual, item, articles

* Enrich links semantics using RDFa

* Enrich Page semantics using RDFa

* Enrich Album semantics using RFDa

* Enrich Event semantics with RDFa
2024-10-16 15:40:53 +02:00

70 lines
1.9 KiB
Text

<h1><%= @page_title %></h1>
<%= raw(@contents) %>
<section id="map">
<h2>Geografisk utspridning</h2>
<figure>
<div id="leaflet" style="aspect-ratio: 1"></div>
</figure>
</section>
<p>
<%= if @nosearch? do %>
Gå direkt till:
<% end %>
</p>
<ul class="months">
<%= for {year, events} <- @events do %>
<li>
<a href={"#y" <> year}><%= year %></a> (<%= Enum.count(events) %>)
</li>
<% end %>
</ul>
<form method="get" action="/evenemang">
<p>
<%= if @nosearch? do %>
Eller
<% end %>
<label for="q">sök innehåll</label>:
<input type="search" value={@q} name="q" id="q" size="7" />
<button>Sök</button>
</p>
</form>
<%= for {year, events} <- @events do %>
<section id={"y" <> year}>
<h2 class="sticky"><%= year %></h2>
<div class="events">
<%= for event <- events do %>
<article class="event" vocab="https://schema.org/" typeof="Event">
<h2>
<a property="name" href={"/" <> event["slug"]}><%= event["title"] %></a>
</h2>
<p property="description"><%= event["lead"] %></p>
<%= if hilights?(event) do %>
<p>
Personliga höjdpunkter: <%= rdfa_bandlist(event["bands"]) |> raw %>
</p>
<% end %>
<%= if missed?(event) do %>
<p>
Band jag missade: <%= bandlist(event["mia"]) %>
</p>
<% end %>
<%= if opening_acts?(event) do %>
<p>
Förband: <%= event["bands"] |> Enum.drop(1) |> rdfa_bandlist() |> raw %>
</p>
<% end %>
<%= if event["poster"] do %>
<img
property="thumbnail"
loading="lazy"
src={"https://n.madr.se/assets/" <> event["poster"] <> "?key=poster"}
alt="affisch"
width="150"
/>
<% end %>
</article>
<% end %>
</div>
</section>
<% end %>