fix: Remove assets from priv/static and put them under site/static

This commit is contained in:
Robert Prehn 2025-01-09 19:03:39 -06:00
parent 1dc69ae161
commit 1f9246e8db
No known key found for this signature in database
16 changed files with 34 additions and 17 deletions

View file

@ -12,6 +12,9 @@ html {
--line-trim: -0.6666666666666667px;
font-size: var(--font-size);
line-height: var(--line-height);
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.container {
@ -22,15 +25,11 @@ a {
@apply text-blue;
}
nav a {
@apply text-dark;
}
.box {
--tw-border-opacity: 1;
border-color: rgb(181 190 255 / var(--tw-border-opacity));
border: 2px solid;
margin: 12px 5px;
margin: 0 5px;
padding: 12px 5px;
padding-left: 29px;
padding-right: 29px;
@ -45,8 +44,12 @@ p {
margin-bottom: var(--vspace);
}
a:hover {
@apply bg-light text-dark;
a:hover, a.current {
@apply bg-light text-dark border-light;
}
a.current {
border: 0;
}
ul>li {

View file

@ -10,7 +10,7 @@ module.exports = {
colors: {
transparent: 'transparent',
current: 'currentColor',
dark: 'rgb(15, 24, 1)',
dark: 'rgb(7, 12, 0)',
red: 'rgb(207, 23, 44)',
green: 'rgb(25, 114, 13)',
yellow: 'rgb(217, 196, 38)',

View file

@ -60,6 +60,7 @@ defmodule PreDotHn do
index = make_index(posts)
PreDotHn.LinkLog.run()
PreDotHn.Static.run()
Enum.map([index | posts], &write_page/1)
end
@ -212,7 +213,7 @@ defmodule PreDotHn do
</head>
<body class="bg-dark font-mono text-light">
<.menu />
<.menu slug={@slug} />
<%= render_slot(@inner_block) %>
</body>
</html>
@ -221,13 +222,11 @@ defmodule PreDotHn do
def menu(assigns) do
~H"""
<nav class="block bg-blue text-dark flex justify-center">
<div class="container flex ml-[-0.95rem]">
<a class="px-[0.6rem]" href="/">About Me</a>
<span>|</span>
<a class="px-[0.6rem]" href="/blog">Blog</a>
<span>|</span>
<a class="px-[0.6rem]" href="/link-log">Link Log</a>
<nav class="text-light flex justify-center">
<div class="container flex">
<a class={"box rounded-tr !mt-[28px] !-mb-[2px] !border-b-light #{if @slug == "index", do: "current"}"} href="/">About Me</a>
<a class={"box rounded-tr !mt-[28px] !-mb-[2px] !border-b-light #{if @slug == "blog", do: "current"}"} href="/blog">Blog</a>
<a class={"box rounded-tr !mt-[28px] !-mb-[2px] !border-b-light #{if @slug == "link-log", do: "current"}"} href="/link-log">Link Log</a>
</div>
</nav>
"""
@ -245,7 +244,7 @@ defmodule PreDotHn do
~H"""
<.layout title={@title} slug={@slug} description={assigns[:description]}>
<main class="container mx-auto py-[2.6rem]">
<main class="container mx-auto z-10 relative">
<section class="box border border-light">
<h1><%= @title %></h1>
<%= {:safe, @body} %>

15
lib/pre_dot_hn/static.ex Normal file
View file

@ -0,0 +1,15 @@
defmodule PreDotHn.Static do
def run() do
"site/static/**/*"
|> Path.wildcard()
|> Enum.each(fn path ->
build_path = String.replace(path, "site", "priv")
if File.dir?(path) do
File.mkdir_p!(build_path)
else
File.copy!(path, build_path)
end
end)
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB