devel #175

Merged
inhji merged 10 commits from devel into main 2023-07-05 16:43:19 +02:00
8 changed files with 41 additions and 58 deletions

View file

@ -67,7 +67,9 @@
</header>
<main class="mx-3 md:mx-0">
<%= @inner_content %>
<section class="mx-auto max-w-2xl">
<%= @inner_content %>
</section>
</main>
<footer class="max-w-full mt-8 p-8 text-theme-base/75 bg-theme-background1">

View file

@ -69,30 +69,19 @@ defmodule ChiyaWeb.PublicComponents do
Renders a note-header with title.
"""
attr :class, :string, default: nil
attr :inline, :boolean, default: false
slot :inner_block, required: true
slot :title, required: true
slot :subtitle
slot :actions
def header(assigns) do
~H"""
<header class={[@actions != [] && "flex items-center justify-between gap-6", @class]}>
<div>
<h1 class="text-lg font-semibold leading-8 text-gray-800 dark:text-gray-200">
<%= render_slot(@inner_block) %>
<span :if={@inline} class="text-sm leading-6 font-normal text-gray-600 dark:text-gray-400">
<%= render_slot(@subtitle) %>
</span>
</h1>
<p
:if={@subtitle != [] && @inline == false}
class="mt-2 text-sm leading-6 text-gray-600 dark:text-gray-400"
>
<%= render_slot(@subtitle) %>
</p>
</div>
<div class="flex-none"><%= render_slot(@actions) %></div>
<header class={["p-8 rounded", @class]}>
<h1 class="text-3xl font-extrabold leading-10 tracking-tight text-theme-primary">
<%= render_slot(@title) %>
</h1>
<p :if={@subtitle != []} class="mt-4 leading-7 text-theme-base/75 uppercase font-semibold">
<%= render_slot(@subtitle) %>
</p>
</header>
"""
end

View file

@ -1,5 +1,5 @@
<article class="h-card hcard">
<section class="mx-auto max-w-2xl p-10 bg-theme-background1 flex gap-3 items-start">
<section class="p-10 bg-theme-background1 flex gap-3 items-start">
<div>
<img
class="rounded-lg w-28 | u-photo"

View file

@ -1,12 +1,10 @@
<div class="mx-auto max-w-xl">
<h1 class="mt-16 text-3xl font-extrabold tracking-tight text-theme-primary">
<%= @channel.name %>
</h1>
<p class="mt-4 text-base leading-7 text-theme-base">
<%= @channel.content %>
</p>
<h1 class="mt-16 text-3xl font-extrabold tracking-tight text-theme-primary">
<%= @channel.name %>
</h1>
<p class="mt-4 text-base leading-7 text-theme-base">
<%= @channel.content %>
</p>
<div class="w-full mt-6 sm:w-auto flex flex-col gap-1.5">
<.note_list notes={@channel.notes} layout={@channel.layout} />
</div>
</div>
<div class="w-full mt-6 sm:w-auto flex flex-col gap-1.5">
<.note_list notes={@channel.notes} layout={@channel.layout} />
</div>

View file

@ -1,13 +1,9 @@
<section class="mx-auto max-w-2xl p-10 bg-theme-background1">
<h1 class="text-3xl font-extrabold leading-10 tracking-tight text-theme-primary | p-name">
<%= @settings.title %>
</h1>
<p class="mt-4 leading-7 text-theme-base/75 uppercase font-semibold | p-summary">
<%= @settings.subtitle %>
</p>
</section>
<.header>
<:title><%= @settings.title %></:title>
<:subtitle><%= @settings.subtitle %></:subtitle>
</.header>
<section class="mx-auto max-w-2xl text-sm my-8">
<section class="text-sm my-8">
<ul class="flex flex-wrap gap-3">
<li>
<a
@ -31,7 +27,7 @@
</section>
<%= if @channel do %>
<section class="mx-auto max-w-2xl mt-8 border-t border-theme-background1">
<section class="mt-8 border-t border-theme-background1">
<.note_list notes={@channel.notes} layout={@channel.layout} />
</section>
<% end %>

View file

@ -1,15 +1,15 @@
<article class="h-entry hentry">
<header class="mx-auto max-w-2xl">
<header>
<h1 class="mt-16 lg:text-5xl md:text-4xl text-3xl font-bold text-theme-base | p-name">
<%= @note.name %>
</h1>
</header>
<section class="mx-auto mt-8 prose prose-gruvbox md:prose-lg lg:prose-xl | p-summary e-content">
<section class="mt-8 prose prose-gruvbox md:prose-lg lg:prose-xl | p-summary e-content">
<%= Markdown.render(@note.content) |> raw %>
</section>
<footer class="mt-8 mx-auto max-w-2xl text-theme-base">
<footer class="mt-8 text-theme-base">
<%= if @note.published_at do %>
<span>Published</span>
<% else %>
@ -41,7 +41,7 @@
<a href={~p"/note/#{@note.slug}"} class="hidden | u-url u-uid"><%= @note.name %></a>
</footer>
<section class="mt-8 mx-auto max-w-2xl">
<section class="mt-8">
<%= if !Enum.empty?(@note.images) do %>
<.line />

View file

@ -1,12 +1,10 @@
<div class="mx-auto max-w-xl">
<h1 class="mt-16 text-3xl font-extrabold tracking-tight text-theme-primary">
Tagged with &ldquo;<%= @tag.name %>&rdquo;
</h1>
<p class="mt-4 text-base leading-7 text-theme-base">
<%= @tag.content %>
</p>
<h1 class="mt-16 text-3xl font-extrabold tracking-tight text-theme-primary">
Tagged with &ldquo;<%= @tag.name %>&rdquo;
</h1>
<p class="mt-4 text-base leading-7 text-theme-base">
<%= @tag.content %>
</p>
<div class="w-full mt-6 sm:w-auto flex flex-col gap-1.5">
<.note_list notes={@tag.notes} />
</div>
</div>
<div class="w-full mt-6 sm:w-auto flex flex-col gap-1.5">
<.note_list notes={@tag.notes} />
</div>

View file

@ -1,5 +1,5 @@
<section>
<header class="mx-auto max-w-2xl">
<header>
<h1 class="mt-16 lg:text-5xl md:text-4xl text-3xl font-bold text-theme-base">
Wiki
</h1>