Merge pull request 'devel' (#238) from devel into main

Reviewed-on: #238
This commit is contained in:
inhji 2023-07-27 22:33:55 +02:00
commit b2bc2bc041
5 changed files with 33 additions and 36 deletions

View file

@ -35,10 +35,10 @@
</style>
</head>
<body class="text-theme-base bg-theme-background | h-feed hfeed">
<aside class="block">
<aside class="block print:hidden">
<%= raw(@settings.custom_html) %>
</aside>
<header class="my-8 block px-3">
<header class="my-8 block px-3 print:hidden">
<nav class="mx-auto max-w-2xl">
<ul class="flex gap-3">
<li>
@ -75,7 +75,7 @@
<%= @inner_content %>
</main>
<footer class="max-w-full mt-8 p-8 text-theme-base/75 bg-theme-background1">
<footer class="max-w-full mt-8 p-8 text-theme-base/75 bg-theme-background1 print:hidden">
<section class="max-w-2xl mx-auto flex gap-3">
<div class="flex-1">
<h2 class="font-bold tracking-wider">Info</h2>
@ -90,7 +90,8 @@
<h2 class="font-bold tracking-wider">Links</h2>
<ul class="list-disc list-inside">
<li><a href="#"><del>Wiki</del></a></li>
<li><a href={~p"/wiki"}>Wiki</a></li>
<li><a href={~p"/about"}>About</a></li>
</ul>
</div>

View file

@ -42,9 +42,11 @@ defmodule ChiyaWeb.PublicComponents do
@doc """
Renders a middot as divider
"""
attr :class, :string, default: "text-theme-primary"
def dot(assigns),
do: ~H"""
<span class="text-theme-primary font-bold">·</span>
<span class={["font-bold", @class]}>·</span>
"""
@doc """
@ -75,6 +77,7 @@ defmodule ChiyaWeb.PublicComponents do
<a href={~p"/tagged-with/#{tag.slug}"} class={["p-category", @class_tag]}>
<%= tag.name %>
</a>
<.dot class="text-theme-base/50 last:hidden" />
<% end %>
</span>
"""
@ -176,18 +179,14 @@ defmodule ChiyaWeb.PublicComponents do
</div>
<footer class="mt-4">
<a href={~p"/note/#{note.slug}"}>
<time class="text-theme-base/75">
<%= pretty_datetime(note.published_at) %>
</time>
<.dot />
</a>
<%= if not Enum.empty?(note.tags) do %>
<.tags note={note} />
<.dot />
<% end %>
<a href={~p"/note/#{note.slug}"} class="text-theme-base/75">Permalink</a>
<%= if not Enum.empty?(note.images) do %>
<.dot />
<.icon name="hero-photo" />
<.tags note={note} class_tag="text-theme-base/75" />
<% end %>
</footer>
</article>

View file

@ -4,7 +4,7 @@
</.header>
<%= if @current_user do %>
<section class="max-w-2xl mx-auto mt-8">
<section class="max-w-2xl mx-auto mt-8 print:hidden">
<ul class="flex gap-3">
<li>
<a href={~p"/admin/notes/#{@note}/edit"} class="button">
@ -21,7 +21,7 @@
</aside>
<%= if has_outline?(@note) do %>
<aside class="max-w-2xl mx-auto mt-8 prose prose-gruvbox">
<aside class="max-w-2xl mx-auto mt-8 prose prose-gruvbox print:hidden">
<div class="bg-theme-background1 rounded p-2">
<%= raw(render_outline(@note)) %>
</div>
@ -64,7 +64,6 @@
</time>
<%= if not Enum.empty?(@note.tags) do %>
<.dot />
<span>Tags</span>
<.tags note={@note} />
<% end %>
<%= if @note.kind != :post do %>

View file

@ -24,7 +24,6 @@
</div>
</aside>
</section>
<% else %>
<section class="mx-auto max-w-2xl">
<.header>

View file

@ -42,5 +42,4 @@
<%= if @setting.show_images_on_home, do: "✅", else: "❌" %>
</:item>
</.list>
<% end %>