chiya/lib/chiya_web/controllers/page_html/note.html.heex

41 lines
1.3 KiB
Text
Raw Normal View History

2023-04-03 22:22:02 +02:00
<div class="mx-auto max-w-xl mx-4 lg:mx-0">
<header>
<h1 class="mt-16 text-3xl font-semibold leading-8 text-theme-heading font-serif">
2023-04-03 22:22:02 +02:00
<%= @note.name %>
</h1>
<p class="mt-2 text-sm leading-6 text-theme-base font-semibold">
<%= pretty_date(@note.published_at) %>
</p>
</header>
2023-04-03 22:22:02 +02:00
<section class="prose mt-8">
<%= Markdown.render(@note.content) |> raw %>
</section>
2023-03-13 03:26:39 +01:00
2023-04-03 22:22:02 +02:00
<%= if !Enum.empty?(@note.images) do %>
<.line />
2023-03-13 05:59:40 +01:00
2023-04-03 22:22:02 +02:00
<div class="flex flex-wrap gap-3" id="images">
<%= for image <- @note.images do %>
<article>
<a href={"#image-#{image.id}"}>
<img
class="rounded-lg w-28 border"
src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)}
/>
</a>
<a href="#images" class="lightbox" id={"image-#{image.id}"}>
<span>
2023-03-31 16:58:10 +02:00
<img
2023-04-03 22:22:02 +02:00
class="md:max-w-screen-sm lg:max-w-screen-md xl:max-w-screen-lg max-h-screen mx-auto"
src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :full_dithered)}
loading="lazy"
2023-03-31 16:58:10 +02:00
/>
2023-04-03 22:22:02 +02:00
<span class="text-theme-background text-center"><%= image.content %></span>
</span>
</a>
</article>
<% end %>
</div>
<% end %>
</div>