start layouts, add empty pages
This commit is contained in:
parent
f4f7f41214
commit
118922be50
7 changed files with 25 additions and 36 deletions
lib/cms_web
|
@ -4,8 +4,6 @@ defmodule CMSWeb.CoreComponents do
|
|||
"""
|
||||
use Phoenix.Component
|
||||
|
||||
alias Phoenix.LiveView.JS
|
||||
|
||||
@doc """
|
||||
Renders a [Heroicon](https://heroicons.com).
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"} />
|
||||
|
|
|
@ -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
|
||||
|
|
0
lib/cms_web/controllers/page_html/microblog.html.heex
Normal file
0
lib/cms_web/controllers/page_html/microblog.html.heex
Normal file
0
lib/cms_web/controllers/page_html/writing.html.heex
Normal file
0
lib/cms_web/controllers/page_html/writing.html.heex
Normal file
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue