diff --git a/lib/cms_web/components/core_components.ex b/lib/cms_web/components/core_components.ex index 82af290..0b07bfa 100644 --- a/lib/cms_web/components/core_components.ex +++ b/lib/cms_web/components/core_components.ex @@ -4,8 +4,6 @@ defmodule CMSWeb.CoreComponents do """ use Phoenix.Component - alias Phoenix.LiveView.JS - @doc """ Renders a [Heroicon](https://heroicons.com). diff --git a/lib/cms_web/components/layouts/app.html.heex b/lib/cms_web/components/layouts/app.html.heex index 3856c46..710ffa1 100644 --- a/lib/cms_web/components/layouts/app.html.heex +++ b/lib/cms_web/components/layouts/app.html.heex @@ -1,31 +1,14 @@ -<header class="px-4 sm:px-6 lg:px-8"> - <div class="flex items-center justify-between border-b border-zinc-100 py-3 text-sm"> - <div class="flex items-center gap-4"> - <a href="/"> - <img src={~p"/images/logo.svg"} width="36" /> - </a> - <p class="bg-brand/5 text-brand rounded-full px-2 font-medium leading-6"> - v{Application.spec(:phoenix, :vsn)} - </p> - </div> - <div class="flex items-center gap-4 font-semibold leading-6 text-zinc-900"> - <a href="https://twitter.com/elixirphoenix" class="hover:text-zinc-700"> - @elixirphoenix - </a> - <a href="https://github.com/phoenixframework/phoenix" class="hover:text-zinc-700"> - GitHub - </a> - <a - href="https://hexdocs.pm/phoenix/overview.html" - class="rounded-lg bg-zinc-100 px-2 py-1 hover:bg-zinc-200/80" - > - Get Started <span aria-hidden="true">→</span> - </a> - </div> - </div> -</header> -<main class="px-4 py-20 sm:px-6 lg:px-8"> - <div class="mx-auto max-w-2xl"> +<div class="flex flex-col md:flex-row mx-auto max-w-3xl"> + <section class="flex flex-col p-2 gap-y-1 border-slate-100 border-b md:border-b-0"> + <.link navigate={~p"/"} class="font-bold hover:underline">sloanelybutsurely.com</.link> + <nav> + <ul> + <li><.link navigate={~p"/writing"} class="hover:underline">writing</.link></li> + <li><.link navigate={~p"/microblog"} class="hover:underline">microblog</.link></li> + </ul> + </nav> + </section> + <main> {@inner_content} - </div> -</main> + </main> +</div> diff --git a/lib/cms_web/components/layouts/root.html.heex b/lib/cms_web/components/layouts/root.html.heex index 3afa6d4..a147bdf 100644 --- a/lib/cms_web/components/layouts/root.html.heex +++ b/lib/cms_web/components/layouts/root.html.heex @@ -4,7 +4,7 @@ <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="csrf-token" content={get_csrf_token()} /> - <.live_title default="CMS" suffix=" ยท Phoenix Framework"> + <.live_title default="sloanelybutsurely.com"> {assigns[:page_title]} </.live_title> <link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} /> diff --git a/lib/cms_web/controllers/page_controller.ex b/lib/cms_web/controllers/page_controller.ex index de1d8fe..62589e9 100644 --- a/lib/cms_web/controllers/page_controller.ex +++ b/lib/cms_web/controllers/page_controller.ex @@ -2,8 +2,14 @@ defmodule CMSWeb.PageController do use CMSWeb, :controller def home(conn, _params) do - # The home page is often custom made, - # so skip the default app layout. - render(conn, :home, layout: false) + render(conn, :home) + end + + def microblog(conn, _params) do + render(conn, :microblog) + end + + def writing(conn, _params) do + render(conn, :writing) end end diff --git a/lib/cms_web/controllers/page_html/microblog.html.heex b/lib/cms_web/controllers/page_html/microblog.html.heex new file mode 100644 index 0000000..e69de29 diff --git a/lib/cms_web/controllers/page_html/writing.html.heex b/lib/cms_web/controllers/page_html/writing.html.heex new file mode 100644 index 0000000..e69de29 diff --git a/lib/cms_web/router.ex b/lib/cms_web/router.ex index 5c7f405..0275435 100644 --- a/lib/cms_web/router.ex +++ b/lib/cms_web/router.ex @@ -18,6 +18,8 @@ defmodule CMSWeb.Router do pipe_through :browser get "/", PageController, :home + get "/writing", PageController, :writing + get "/microblog", PageController, :microblog end # Other scopes may use custom stacks.