From 625cbdd00a109ddce08263be88d80febe143fc24 Mon Sep 17 00:00:00 2001
From: Inhji
Date: Fri, 2 Jun 2023 07:31:47 +0200
Subject: [PATCH] improve menu, fix tag page
---
assets/css/app.css | 4 ++++
lib/chiya_web/components/core_components.ex | 4 ++--
.../components/layouts/root_public.html.heex | 16 ++++++++++------
lib/chiya_web/controllers/page_controller.ex | 7 +++++++
.../controllers/page_html/tag.html.heex | 14 +++-----------
lib/chiya_web/router.ex | 2 ++
6 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/assets/css/app.css b/assets/css/app.css
index 511093a..4c51028 100644
--- a/assets/css/app.css
+++ b/assets/css/app.css
@@ -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 {
diff --git a/lib/chiya_web/components/core_components.ex b/lib/chiya_web/components/core_components.ex
index 5520d24..6df1a54 100644
--- a/lib/chiya_web/components/core_components.ex
+++ b/lib/chiya_web/components/core_components.ex
@@ -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">
- 🌙
- ☀️
+ 🌙
+ ☀️
"""
end
diff --git a/lib/chiya_web/components/layouts/root_public.html.heex b/lib/chiya_web/components/layouts/root_public.html.heex
index 4030e2e..a60b564 100644
--- a/lib/chiya_web/components/layouts/root_public.html.heex
+++ b/lib/chiya_web/components/layouts/root_public.html.heex
@@ -39,13 +39,19 @@
@@ -68,8 +74,6 @@
<%= identity.name %>
<.dot />
<% end %>
- About
- <.dot />
Admin
diff --git a/lib/chiya_web/controllers/page_controller.ex b/lib/chiya_web/controllers/page_controller.ex
index 322bca5..a2febf9 100644
--- a/lib/chiya_web/controllers/page_controller.ex
+++ b/lib/chiya_web/controllers/page_controller.ex
@@ -54,4 +54,11 @@ defmodule ChiyaWeb.PageController do
)
end
end
+
+ ### ========= REDIRECTS
+
+ def about(conn, _params) do
+ redirect(conn, to: ~p"/note/about")
+ end
+
end
diff --git a/lib/chiya_web/controllers/page_html/tag.html.heex b/lib/chiya_web/controllers/page_html/tag.html.heex
index 14e5abd..6261ed1 100644
--- a/lib/chiya_web/controllers/page_html/tag.html.heex
+++ b/lib/chiya_web/controllers/page_html/tag.html.heex
@@ -1,5 +1,5 @@
-
-
+
diff --git a/lib/chiya_web/router.ex b/lib/chiya_web/router.ex
index c416668..3db8c3e 100644
--- a/lib/chiya_web/router.ex
+++ b/lib/chiya_web/router.ex
@@ -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