Break the Tags page into its own controller.
This commit is contained in:
parent
44a6f076aa
commit
251c4b7d72
|
@ -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")
|
||||||
|
|
9
lib/jol_web/controllers/tag_controller.ex
Normal file
9
lib/jol_web/controllers/tag_controller.ex
Normal 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
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue