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" />
|
2024-11-18 17:10:08 +02:00
|
|
|
<!-- optional javascript: only used for highlighting active page in nav -->
|
|
|
|
<script type="text/javascript" src="/js/site.js" />
|
2024-11-08 18:33:02 +02:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<header>
|
|
|
|
<nav>
|
2024-11-18 17:10:08 +02:00
|
|
|
<a class="nav-link" href="/">Home</a>
|
|
|
|
<a class="nav-link" href="/about">About</a>
|
|
|
|
<a class="nav-link" href="/blog">Blog</a>
|
|
|
|
<a class="nav-link" href="/projects">Projects</a>
|
|
|
|
<sitename>
|
|
|
|
<h1><a href="#"><%= @page[:title] %></a></h1>
|
|
|
|
</sitename>
|
2024-11-08 18:33:02 +02:00
|
|
|
</nav>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<main>
|
|
|
|
<%= render(@inner_content) %>
|
|
|
|
</main>
|
|
|
|
|
|
|
|
<footer>
|
2024-11-18 17:10:08 +02:00
|
|
|
<nav>
|
|
|
|
<a href="https://code.criminallycute.fi/CriminallyCute/website">source</a>
|
|
|
|
<a class="underline" href="/feed.xml">RSS</a>
|
|
|
|
<copyright>
|
|
|
|
© <%= Date.utc_today().year %> Criminally Cute
|
|
|
|
</copyright>
|
|
|
|
</nav>
|
2024-11-08 18:33:02 +02:00
|
|
|
</footer>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|
|
|
|
<%= if Mix.env() == :dev do %>
|
|
|
|
<%= Phoenix.HTML.raw(Tableau.live_reload(assigns)) %>
|
|
|
|
<% end %>
|
|
|
|
"""
|
|
|
|
|> Phoenix.HTML.Safe.to_iodata()
|
|
|
|
end
|
|
|
|
end
|