improve menu, fix tag page

This commit is contained in:
Inhji 2023-06-02 07:31:47 +02:00
parent 64d8936436
commit 625cbdd00a
6 changed files with 28 additions and 19 deletions

View file

@ -102,6 +102,10 @@
.footnotes hr { display: none; }
.footnote:before { content: '{'; }
.footnote:after { content: '}'; }
body > header nav a {
@apply text-theme-base px-3 py-2.5 border border-theme-background1 hover:bg-theme-background1 rounded transition font-semibold;
}
}
@layer utilities {

View file

@ -33,8 +33,8 @@ defmodule ChiyaWeb.CoreComponents do
def darkmode_toggle(assigns) do
~H"""
<.link href="#" id="dark-mode-toggle" class="text-sm leading-6">
<span class="hidden dark:inline bg-blue-900 p-1 rounded">🌙</span>
<span class="inline dark:hidden bg-blue-600 p-1 rounded"></span>
<span class="hidden dark:inline">🌙</span>
<span class="inline dark:hidden"></span>
</.link>
"""
end

View file

@ -39,13 +39,19 @@
<nav>
<ul class="flex gap-3">
<li>
<a
href="/"
class="text-theme-base px-3 py-2.5 border border-theme-background1 hover:bg-theme-background1 rounded transition font-semibold"
>
<a href="/">
<.icon name="hero-home" /> Home
</a>
</li>
<li>
<a href="/about">
<.icon name="hero-hand-raised" /> About
</a>
</li>
<li class="flex-1"></li>
<li>
<.darkmode_toggle />
</li>
</ul>
</nav>
</header>
@ -68,8 +74,6 @@
<span><a href={identity.url}><%= identity.name %></a></span>
<.dot />
<% end %>
<span><a href={~p"/note/about"}>About</a></span>
<.dot />
<span><a href={~p"/admin"}>Admin</a></span>
</p>
</footer>

View file

@ -54,4 +54,11 @@ defmodule ChiyaWeb.PageController do
)
end
end
### ========= REDIRECTS
def about(conn, _params) do
redirect(conn, to: ~p"/note/about")
end
end

View file

@ -1,5 +1,5 @@
<div class="mx-auto max-w-xl mx-4 lg:mx-0">
<h1 class="mt-16 text-[2rem] font-semibold font-serif leading-10 tracking-tighter text-theme-heading">
<div class="mx-auto max-w-xl">
<h1 class="mt-16 text-3xl font-extrabold tracking-tight text-theme-primary">
Tagged with &ldquo;<%= @tag.name %>&rdquo;
</h1>
<p class="mt-4 text-base leading-7 text-theme-base">
@ -7,14 +7,6 @@
</p>
<div class="w-full mt-6 sm:w-auto flex flex-col gap-1.5">
<%= for note <- @tag.notes do %>
<a
href={~p"/note/#{note.slug}"}
class="rounded -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 %>
<.note_list notes={@tag.notes} />
</div>
</div>

View file

@ -135,6 +135,8 @@ defmodule ChiyaWeb.Router do
get "/tagged-with/:slug", PageController, :tag
get "/", PageController, :home
get "/about", PageController, :about
post "/note/:slug/comment", CommentController, :create
end
end