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

65 lines
1.7 KiB
Text

<h1>Delningar</h1>
<p>
Länkar som är värda att uppmärksammas och lämna åsikt om.
</p>
<%= for {date, links} <- @links do %>
<section id={"d" <> date}>
<div class="links">
<h2>
<%= date
|> Date.from_iso8601!()
|> Calendar.strftime(
"%A, %d %B %Y",
month_names: fn m ->
Enum.at(
[
"januari",
"februari",
"mars",
"april",
"maj",
"juni",
"juli",
"augusti",
"september",
"oktober",
"november",
"december"
],
m - 1
)
end,
day_of_week_names: fn d ->
Enum.at(
[
"måndag",
"tisdag",
"onsdag",
"torsdag",
"fredag",
"lördag",
"söndag"
],
d - 1
)
end
)
|> String.replace(~r/ 0/, " ") %>
</h2>
<%= for link <- links do %>
<article vocab="https://schema.org/" typeof="WebContent Review" class="bookmark">
<h3>
<span property="name"><%= link["title"] %></span>
<a class="permalink" href={"/" <> link["slug"]} title="Permalänk">#</a>
</h3>
<div property="reviewBody">
<%= link["contents"] |> Earmark.as_html!() |> raw %>
</div>
<div class="source">
Källa: <a href={link["source"]} rel="external"><%= link["h1"] %></a>
</div>
</article>
<% end %>
</div>
</section>
<% end %>