Break the Tags page into its own controller.

This commit is contained in:
Jessica Canady 2024-08-22 10:16:14 -04:00
parent 44a6f076aa
commit 251c4b7d72
Signed by: phoenix
SSH key fingerprint: SHA256:aaLOzOrLi+0n4eDZNQKH97PehwRt6KSE5fYJc+ZRKCQ
4 changed files with 10 additions and 9 deletions

View file

@ -8,14 +8,6 @@ defmodule JOLWeb.PageController do
|> render(:home) |> render(:home)
end end
@spec tags(Plug.Conn.t(), any()) :: Plug.Conn.t()
def tags(conn, _params) do
conn
|> assign(:tags, JOL.Blog.unique_tag_list())
|> assign(:page_title, "Post Tags")
|> render(:tags)
end
def about(conn, _params) do def about(conn, _params) do
conn conn
|> assign(:page_title, "About Jessica") |> assign(:page_title, "About Jessica")

View file

@ -0,0 +1,9 @@
defmodule JOLWeb.TagController do
use JOLWeb, :controller
def index(conn, _params) do
conn
|> assign(:page_title, "Jess Uses These Tags")
|> render(:index)
end
end

View file

@ -22,7 +22,7 @@ defmodule JOLWeb.Router do
pipe_through :browser pipe_through :browser
get "/", PageController, :home get "/", PageController, :home
get "/tags", PageController, :tags get "/tags", TagController, :index
get "/archive", PageController, :archive get "/archive", PageController, :archive
get "/about", PageController, :about get "/about", PageController, :about
get "/now", PageController, :now get "/now", PageController, :now