chiya/lib/chiya_web/controllers/page_html/home.html.heex
2023-04-29 09:43:34 +02:00

77 lines
2.7 KiB
Text

<div class="mx-auto max-w-xl mx-4 lg:mx-0">
<h1 class="mt-16 text-3xl font-semibold font-serif leading-10 tracking-tighter text-theme-heading">
<%= @settings.title %>
</h1>
<p class="mt-4 text-base leading-7 text-theme-base">
<%= @settings.subtitle %>
</p>
<div class="w-full mt-6 sm:w-auto">
<div class="flex gap-4 text-sm leading-6 text-theme-base">
<%= for identity <- @public_identities do %>
<div>
<a
rel={identity.rel}
href={identity.url}
class="group -mx-2 -my-0.5 inline-flex items-center gap-3 rounded-lg px-2 py-0.5 hover:bg-theme-primary/10 transition"
>
<%= raw(identity.icon) %>
<%= identity.name %>
</a>
</div>
<% end %>
</div>
</div>
<%= if @channel do %>
<%= if @channel.layout == :default do %>
<section class="default | mt-6 sm:w-auto flex flex-col gap-1.5">
<%= for note <- @channel.notes do %>
<a
href={~p"/#{note.slug}"}
class="rounded-lg -mx-2 -my-0.5 px-2 py-0.5 hover:bg-theme-primary/10 transition"
>
<span class="text-theme-primary text-lg font-semibold leading-8">
<%= note.name %>
</span>
<span class="text-theme-base text-sm"><%= pretty_date(note.published_at) %></span>
</a>
<% end %>
</section>
<% end %>
<%= if @channel.layout == :gallery do %>
<section class="gallery | mt-6">
<%= for note <- @channel.notes do %>
<article>
<section class="flex flex-wrap justify-start gap-3">
<%= for image <- note.images do %>
<a
href={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :full_dithered)}
class="lightbox | w-28"
data-gallery="note"
data-description={ChiyaWeb.Markdown.render(image.content)}
>
<img
src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)}
loading="lazy"
/>
</a>
<% end %>
</section>
<a
href={~p"/#{note.slug}"}
class="text-theme-primary text-lg/10 font-semibold rounded-lg -mx-2 -my-0.5 px-2 py-0.5 hover:bg-theme-primary/10 transition"
>
<%= note.name %>
<span class="text-theme-muted font-normal text-sm">
<%= pretty_date(note.published_at) %>
</span>
</a>
</article>
<.line />
<% end %>
</section>
<% end %>
<% end %>
</div>