2024-11-08 18:33:02 +02:00
|
|
|
defmodule Website.RootLayout do
|
|
|
|
use Tableau.Layout
|
|
|
|
use Phoenix.Component
|
|
|
|
|
|
|
|
def template(assigns) do
|
|
|
|
~H"""
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
<!-- meta name="color-scheme" content="dark light" /-->
|
|
|
|
<title>
|
|
|
|
<%= [@page[:title], "Criminally Cute"]
|
|
|
|
|> Enum.filter(& &1)
|
|
|
|
|> Enum.intersperse("|")
|
|
|
|
|> Enum.join(" ") %>
|
|
|
|
</title>
|
|
|
|
<link rel="icon" type="image/png" href="/favicon.png" />
|
|
|
|
<link rel="stylesheet" href="/css/site.css" />
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<header>
|
|
|
|
<nav>
|
|
|
|
<ul>
|
|
|
|
<li><a href="/">Home</a></li>
|
|
|
|
<li><a href="/about">About</a></li>
|
|
|
|
<li><a href="/blog">Blog</a></li>
|
|
|
|
<li><a href="/projects">Projects</a></li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
<div>
|
|
|
|
<h1><%= @page[:title] %></h1>
|
2024-11-08 19:02:18 +02:00
|
|
|
<h2>This is a test site, please pardon the clutter.</h2>
|
2024-11-08 18:33:02 +02:00
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<main>
|
|
|
|
<%= render(@inner_content) %>
|
|
|
|
</main>
|
|
|
|
|
|
|
|
<footer>
|
|
|
|
<ul>
|
|
|
|
<li>some link</li>
|
|
|
|
<li>some link 2</li>
|
|
|
|
</ul>
|
|
|
|
<div>
|
|
|
|
<p>© <%= Date.utc_today().year %> Criminally Cute</p>
|
|
|
|
<p><a class="underline" href="/feed.xml">RSS</a></p>
|
|
|
|
</div>
|
|
|
|
</footer>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|
|
|
|
<%= if Mix.env() == :dev do %>
|
|
|
|
<%= Phoenix.HTML.raw(Tableau.live_reload(assigns)) %>
|
|
|
|
<% end %>
|
|
|
|
"""
|
|
|
|
|> Phoenix.HTML.Safe.to_iodata()
|
|
|
|
end
|
|
|
|
end
|