25/lib/mse25_web/controllers/page_html/search.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

71 lines
1.9 KiB
Text

<form metod="get" action="/sok">
<label for="q">Sök innehåll</label>: <input size="9" type="search" id="q" name="q" value={@q} />
<button>Sök</button>
</form>
<h1><%= @page_title %></h1>
<%= for item = %{t: t} <- @results do %>
<article>
<%= if t == :articles do %>
<h3>
<a href={"/" <> item["slug"]}>
<%= item["title"] %>
</a>
</h3>
<% end %>
<%= if t == :events do %>
<h3>
<a href={"/" <> item["slug"]}>
<%= item["title"] %>
</a>
</h3>
<p><%= item["lead"] %></p>
<%= if item["poster"] do %>
<img
src={ "https://n.madr.se/assets/" <> item["poster"] <> "?key=poster"}
loading="lazy"
alt="Affisch"
width="200"
/>
<% end %>
<% end %>
<%= if t == :links do %>
<h3>
<%= item["title"] %>
</h3>
<p><%= raw(Earmark.as_html!(item["contents"])) %></p>
Källa:
<a href={"/" <> item["source"]}>
<%= item["h1"] %>
</a>
<% end %>
<%= if t == :albums do %>
<h3>
<%= item["artist"] <>
" - " <> item["album"] <> " (" <> to_string(item["year"]) <> ")" %>
<a
class="permalink"
href={"/" <> to_string(@year) <> "/brutal-legend-" <> item["externalId"]}
>
#
</a>
</h3>
<%= if item["contents"] do %>
<p><%= raw(Earmark.as_html!(item["contents"])) %></p>
<% end %>
<ul>
<%= for song <- item["songs"] do %>
<li><%= song["artist"]["name"] <> " - " <> song["title"] %></li>
<% end %>
</ul>
<%= if item["cover"] do %>
<img
src={"https://n.madr.se/assets/" <> item["cover"] <> "?key=rectangular"}
alt="Skivomslag"
loading="lazy"
height="75"
width="75"
/>
<% end %>
<% end %>
</article>
<% end %>