add basic hcard

This commit is contained in:
Inhji 2023-07-03 20:38:35 +02:00
parent 7d2c3aceef
commit 6fddb85c2e
2 changed files with 33 additions and 3 deletions

View file

@ -55,9 +55,15 @@ defmodule ChiyaWeb.PageController do
end
end
### ========= REDIRECTS
def about(conn, _params) do
redirect(conn, to: ~p"/note/about")
note = Chiya.Notes.get_note_by_slug_preloaded("about")
user = Chiya.Accounts.get_user!(1)
render(conn, :about,
layout: {ChiyaWeb.Layouts, "public.html"},
note: note,
user: user,
page_title: "About"
)
end
end

View file

@ -0,0 +1,24 @@
<article class="h-card hcard">
<section class="mx-auto max-w-2xl p-10 bg-theme-background1 flex gap-3 items-start">
<div>
<img
class="rounded-lg w-28 | u-photo"
src={ChiyaWeb.Uploaders.UserImage.url({@user.user_image, @current_user}, :thumb)}
/>
</div>
<div>
<h1 class="text-3xl font-extrabold leading-10 tracking-tight text-theme-primary | p-name">
<%= @user.name %>
</h1>
<section class="mx-auto mt-8 prose prose-gruvbox | p-note">
<%= Markdown.render(@user.bio) |> raw() %>
</section>
</div>
</section>
<%= if @note do %>
<section class="mx-auto mt-8 prose prose-gruvbox md:prose-lg lg:prose-xl | p-summary e-content">
<%= Markdown.render(@note.content) |> raw %>
</section>
<% end %>
</article>