some simple UI to make it work
This commit is contained in:
@@ -3,17 +3,34 @@
|
||||
{% block title %}Edit About{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Edit About</h1>
|
||||
<div class="space-y-2">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">Edit About</h1>
|
||||
<p class="text-sm opacity-70">Update the public about page.</p>
|
||||
</div>
|
||||
<a href="/about" class="btn btn-ghost btn-sm">View page</a>
|
||||
</div>
|
||||
|
||||
<form method="post" action="/admin/about">
|
||||
<label>
|
||||
Title
|
||||
<input type="text" name="title" value="{{ page.title }}" required>
|
||||
</label>
|
||||
<label>
|
||||
Content
|
||||
<textarea name="content" rows="16" required>{{ page.content }}</textarea>
|
||||
</label>
|
||||
<button type="submit">Save</button>
|
||||
</form>
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
<form method="post" action="/admin/about" class="space-y-2">
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Title</span></label>
|
||||
<input type="text" name="title" value="{{ page.title }}" required class="input input-bordered w-full">
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Content</span></label>
|
||||
<textarea name="content" rows="16" required class="textarea textarea-bordered w-full">{{ page.content }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2 pt-2">
|
||||
<button type="submit" class="btn btn-neutral btn-sm">Save</button>
|
||||
<a href="/admin/dashboard" class="btn btn-ghost btn-sm">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
||||
<style>
|
||||
.btn { --animation-btn: 0; --btn-focus-scale: 1; }
|
||||
@media (min-width: 768px) {
|
||||
.nav-menu { flex-direction: row; }
|
||||
}
|
||||
#nav-backdrop { display: none; }
|
||||
@media (max-width: 767px) {
|
||||
#nav-backdrop {
|
||||
@@ -59,15 +62,17 @@
|
||||
<header class="navbar bg-base-100 shadow-sm">
|
||||
<nav class="mx-auto flex w-full max-w-6xl items-center justify-between gap-2 px-4">
|
||||
<a href="/admin/dashboard" class="min-w-0 truncate text-lg font-bold">Admin</a>
|
||||
<div class="hidden items-center gap-1 md:flex">
|
||||
<a href="/admin/dashboard" class="btn btn-ghost btn-sm">Dashboard</a>
|
||||
<a href="/admin/blog/articles" class="btn btn-ghost btn-sm">Blog</a>
|
||||
<a href="/admin/about" class="btn btn-ghost btn-sm">About</a>
|
||||
<a href="/" class="btn btn-ghost btn-sm">View site</a>
|
||||
<form method="post" action="/admin/logout">
|
||||
<button type="submit" class="btn btn-ghost btn-sm">Logout</button>
|
||||
</form>
|
||||
</div>
|
||||
<ul class="nav-menu menu menu-sm hidden items-center gap-1 md:flex">
|
||||
<li><a href="/admin/dashboard">Dashboard</a></li>
|
||||
<li><a href="/admin/blog/articles">Blog</a></li>
|
||||
<li><a href="/admin/about">About</a></li>
|
||||
<li><a href="/">View site</a></li>
|
||||
<li>
|
||||
<form method="post" action="/admin/logout">
|
||||
<button type="submit" class="w-full">Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="flex items-center gap-1">
|
||||
<div class="dropdown dropdown-end md:hidden">
|
||||
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Menu">
|
||||
@@ -76,16 +81,18 @@
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
|
||||
</svg>
|
||||
</div>
|
||||
<div tabindex="0"
|
||||
class="dropdown-content z-50 mt-3 flex w-52 flex-col gap-1 rounded-box border border-base-300 bg-base-100 p-2 shadow-lg">
|
||||
<a href="/admin/dashboard" class="btn btn-ghost btn-sm justify-start">Dashboard</a>
|
||||
<a href="/admin/blog/articles" class="btn btn-ghost btn-sm justify-start">Blog</a>
|
||||
<a href="/admin/about" class="btn btn-ghost btn-sm justify-start">About</a>
|
||||
<a href="/" class="btn btn-ghost btn-sm justify-start">View site</a>
|
||||
<form method="post" action="/admin/logout">
|
||||
<button type="submit" class="btn btn-ghost btn-sm w-full justify-start">Logout</button>
|
||||
</form>
|
||||
</div>
|
||||
<ul tabindex="0"
|
||||
class="menu dropdown-content z-50 mt-3 w-52 rounded-box border border-base-300 bg-base-100 p-2 shadow-lg">
|
||||
<li><a href="/admin/dashboard">Dashboard</a></li>
|
||||
<li><a href="/admin/blog/articles">Blog</a></li>
|
||||
<li><a href="/admin/about">About</a></li>
|
||||
<li><a href="/">View site</a></li>
|
||||
<li>
|
||||
<form method="post" action="/admin/logout">
|
||||
<button type="submit" class="w-full">Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="dropdown dropdown-end">
|
||||
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Settings" title="Settings">
|
||||
|
||||
@@ -3,34 +3,61 @@
|
||||
{% block title %}Blog Articles{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Blog Articles</h1>
|
||||
<p><a href="/admin/blog/articles/new">New article</a></p>
|
||||
<div class="space-y-2">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">Blog Articles</h1>
|
||||
<p class="text-sm opacity-70">Create, edit, and remove blog posts.</p>
|
||||
</div>
|
||||
<a href="/admin/blog/articles/new" class="btn btn-neutral btn-sm">New article</a>
|
||||
</div>
|
||||
|
||||
{% if articles | length > 0 %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for article in articles %}
|
||||
<tr>
|
||||
<td>{{ article.title }}</td>
|
||||
<td>{% if article.published %}Published{% else %}Draft{% endif %}</td>
|
||||
<td>
|
||||
<a href="/admin/blog/articles/{{ article.id }}/edit">Edit</a>
|
||||
<form method="post" action="/admin/blog/articles/{{ article.id }}/delete">
|
||||
<button type="submit">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>No articles yet.</p>
|
||||
{% endif %}
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
{% if articles | length > 0 %}
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Status</th>
|
||||
<th class="text-right">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for article in articles %}
|
||||
<tr>
|
||||
<td class="font-medium">{{ article.title }}</td>
|
||||
<td>
|
||||
{% if article.published %}
|
||||
<span class="badge">Published</span>
|
||||
{% else %}
|
||||
<span class="badge opacity-70">Draft</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex gap-2">
|
||||
<a href="/admin/blog/articles/{{ article.id }}/edit" class="btn btn-ghost btn-sm">Edit</a>
|
||||
<form method="post" action="/admin/blog/articles/{{ article.id }}/delete">
|
||||
<button type="submit" class="btn btn-ghost btn-sm">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-center">
|
||||
<p class="font-medium">No articles yet.</p>
|
||||
<p class="text-sm opacity-70">Create the first blog post.</p>
|
||||
<div class="pt-2">
|
||||
<a href="/admin/blog/articles/new" class="btn btn-neutral btn-sm">New article</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
@@ -3,29 +3,49 @@
|
||||
{% block title %}New Article{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h1>New Article</h1>
|
||||
<div class="space-y-2">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">New Article</h1>
|
||||
<p class="text-sm opacity-70">Create a blog post for the public site.</p>
|
||||
</div>
|
||||
<a href="/admin/blog/articles" class="btn btn-ghost btn-sm">Back to articles</a>
|
||||
</div>
|
||||
|
||||
<form method="post" action="/admin/blog/articles">
|
||||
<label>
|
||||
Title
|
||||
<input type="text" name="title" required>
|
||||
</label>
|
||||
<label>
|
||||
Excerpt
|
||||
<textarea name="excerpt" rows="4"></textarea>
|
||||
</label>
|
||||
<label>
|
||||
Content
|
||||
<textarea name="content" rows="18" required></textarea>
|
||||
</label>
|
||||
<label>
|
||||
Featured image id
|
||||
<input type="text" name="featured_image_id">
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="published">
|
||||
Published
|
||||
</label>
|
||||
<button type="submit">Create</button>
|
||||
</form>
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
<form method="post" action="/admin/blog/articles" class="space-y-2">
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Title</span></label>
|
||||
<input type="text" name="title" required class="input input-bordered w-full">
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Excerpt</span></label>
|
||||
<textarea name="excerpt" rows="4" class="textarea textarea-bordered w-full"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Content</span></label>
|
||||
<textarea name="content" rows="18" required class="textarea textarea-bordered w-full"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Featured image id</span></label>
|
||||
<input type="text" name="featured_image_id" class="input input-bordered w-full">
|
||||
</div>
|
||||
|
||||
<label class="label cursor-pointer justify-start gap-2">
|
||||
<input type="checkbox" name="published" class="checkbox checkbox-sm">
|
||||
<span class="label-text">Published</span>
|
||||
</label>
|
||||
|
||||
<div class="flex flex-wrap gap-2 pt-2">
|
||||
<button type="submit" class="btn btn-neutral btn-sm">Create</button>
|
||||
<a href="/admin/blog/articles" class="btn btn-ghost btn-sm">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
@@ -3,11 +3,41 @@
|
||||
{% block title %}Admin{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Admin</h1>
|
||||
<p>Logged in as {{ admin.email }}</p>
|
||||
<div class="space-y-2">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">Dashboard</h1>
|
||||
<p class="text-sm opacity-70">Logged in as {{ admin.email }}</p>
|
||||
</div>
|
||||
<a href="/" class="btn btn-ghost btn-sm">View site</a>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="/admin/blog/articles">Manage blog articles</a></li>
|
||||
<li><a href="/admin/about">Edit about page</a></li>
|
||||
</ul>
|
||||
<div class="grid grid-cols-2 gap-4 pt-4">
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<h2 class="card-title text-base">Blog</h2>
|
||||
<span class="badge">Content</span>
|
||||
</div>
|
||||
<p class="text-sm opacity-70">Create and update blog articles.</p>
|
||||
<div class="pt-2">
|
||||
<a href="/admin/blog/articles" class="btn btn-neutral btn-sm">Manage blog</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<h2 class="card-title text-base">About page</h2>
|
||||
<span class="badge">Page</span>
|
||||
</div>
|
||||
<p class="text-sm opacity-70">Edit the public about page content.</p>
|
||||
<div class="pt-2">
|
||||
<a href="/admin/about" class="btn btn-neutral btn-sm">Edit about</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
||||
<style>
|
||||
.btn { --animation-btn: 0; --btn-focus-scale: 1; }
|
||||
@media (min-width: 768px) {
|
||||
.nav-menu { flex-direction: row; }
|
||||
}
|
||||
#nav-backdrop { display: none; }
|
||||
@media (max-width: 767px) {
|
||||
#nav-backdrop {
|
||||
@@ -59,19 +62,21 @@
|
||||
<header class="navbar bg-base-100 shadow-sm">
|
||||
<nav class="mx-auto flex w-full max-w-6xl items-center justify-between gap-2 px-4">
|
||||
<a href="/" class="min-w-0 truncate text-lg font-bold">Universal Web</a>
|
||||
<div class="hidden items-center gap-1 md:flex">
|
||||
<a href="/" class="btn btn-ghost btn-sm">Home</a>
|
||||
<a href="/about" class="btn btn-ghost btn-sm">About</a>
|
||||
<a href="/blog" class="btn btn-ghost btn-sm">Blog</a>
|
||||
<ul class="nav-menu menu menu-sm hidden items-center gap-1 md:flex">
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/about">About</a></li>
|
||||
<li><a href="/blog">Blog</a></li>
|
||||
{% if logged_in_admin %}
|
||||
<a href="/admin/dashboard" class="btn btn-ghost btn-sm">Dashboard</a>
|
||||
<form method="post" action="/admin/logout">
|
||||
<button type="submit" class="btn btn-ghost btn-sm">Logout</button>
|
||||
</form>
|
||||
<li><a href="/admin/dashboard">Dashboard</a></li>
|
||||
<li>
|
||||
<form method="post" action="/admin/logout">
|
||||
<button type="submit" class="w-full">Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
{% else %}
|
||||
<a href="/admin/login" class="btn btn-ghost btn-sm">Admin</a>
|
||||
<li><a href="/admin/login">Admin</a></li>
|
||||
{% endif %}
|
||||
</div>
|
||||
</ul>
|
||||
<div class="flex items-center gap-1">
|
||||
<div class="dropdown dropdown-end md:hidden">
|
||||
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Menu">
|
||||
@@ -80,20 +85,22 @@
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
|
||||
</svg>
|
||||
</div>
|
||||
<div tabindex="0"
|
||||
class="dropdown-content z-50 mt-3 flex w-52 flex-col gap-1 rounded-box border border-base-300 bg-base-100 p-2 shadow-lg">
|
||||
<a href="/" class="btn btn-ghost btn-sm justify-start">Home</a>
|
||||
<a href="/about" class="btn btn-ghost btn-sm justify-start">About</a>
|
||||
<a href="/blog" class="btn btn-ghost btn-sm justify-start">Blog</a>
|
||||
<ul tabindex="0"
|
||||
class="menu dropdown-content z-50 mt-3 w-52 rounded-box border border-base-300 bg-base-100 p-2 shadow-lg">
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/about">About</a></li>
|
||||
<li><a href="/blog">Blog</a></li>
|
||||
{% if logged_in_admin %}
|
||||
<a href="/admin/dashboard" class="btn btn-ghost btn-sm justify-start">Dashboard</a>
|
||||
<form method="post" action="/admin/logout">
|
||||
<button type="submit" class="btn btn-ghost btn-sm w-full justify-start">Logout</button>
|
||||
</form>
|
||||
<li><a href="/admin/dashboard">Dashboard</a></li>
|
||||
<li>
|
||||
<form method="post" action="/admin/logout">
|
||||
<button type="submit" class="w-full">Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
{% else %}
|
||||
<a href="/admin/login" class="btn btn-ghost btn-sm justify-start">Admin</a>
|
||||
<li><a href="/admin/login">Admin</a></li>
|
||||
{% endif %}
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="dropdown dropdown-end">
|
||||
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Settings" title="Settings">
|
||||
|
||||
@@ -3,18 +3,45 @@
|
||||
{% block title %}Blog{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Blog</h1>
|
||||
<div class="space-y-2">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">Blog</h1>
|
||||
<p class="text-sm opacity-70">Published articles.</p>
|
||||
</div>
|
||||
{% if logged_in_admin %}
|
||||
<a href="/admin/blog/articles" class="btn btn-ghost btn-sm">Manage blog</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if articles | length > 0 %}
|
||||
<ul>
|
||||
{% for article in articles %}
|
||||
<li>
|
||||
<a href="/blog/{{ article.slug }}">{{ article.title }}</a>
|
||||
{% if article.excerpt %}<p>{{ article.excerpt }}</p>{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>No published posts yet.</p>
|
||||
{% endif %}
|
||||
{% if articles | length > 0 %}
|
||||
<div class="grid gap-4 pt-4">
|
||||
{% for article in articles %}
|
||||
<article class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<h2 class="card-title text-base">
|
||||
<a href="/blog/{{ article.slug }}">{{ article.title }}</a>
|
||||
</h2>
|
||||
<span class="badge">Post</span>
|
||||
</div>
|
||||
{% if article.excerpt %}
|
||||
<p class="text-sm leading-relaxed opacity-80">{{ article.excerpt }}</p>
|
||||
{% endif %}
|
||||
<div class="pt-2">
|
||||
<a href="/blog/{{ article.slug }}" class="btn btn-neutral btn-sm">Read</a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body text-center">
|
||||
<p class="font-medium">No published posts yet.</p>
|
||||
<p class="text-sm opacity-70">Published articles will appear here.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
@@ -3,10 +3,23 @@
|
||||
{% block title %}{{ article.title }}{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<article>
|
||||
<h1>{{ article.title }}</h1>
|
||||
<p>Views: {{ article.view_count }}</p>
|
||||
{% if article.excerpt %}<p>{{ article.excerpt }}</p>{% endif %}
|
||||
<div>{{ article.content | linebreaksbr | safe }}</div>
|
||||
<article class="space-y-2">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">{{ article.title }}</h1>
|
||||
<p class="text-sm opacity-70">Views: {{ article.view_count }}</p>
|
||||
</div>
|
||||
<a href="/blog" class="btn btn-ghost btn-sm">Back to blog</a>
|
||||
</div>
|
||||
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
{% if article.excerpt %}
|
||||
<p class="text-base leading-relaxed opacity-80">{{ article.excerpt }}</p>
|
||||
<div class="border-t border-base-300 pt-4"></div>
|
||||
{% endif %}
|
||||
<div class="leading-relaxed whitespace-pre-line">{{ article.content }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
{% endblock content %}
|
||||
|
||||
@@ -3,21 +3,45 @@
|
||||
{% block title %}Home{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Home</h1>
|
||||
<div class="space-y-2">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">Universal Web</h1>
|
||||
<p class="text-sm opacity-70">Latest updates from the site.</p>
|
||||
</div>
|
||||
<a href="/blog" class="btn btn-ghost btn-sm">All posts</a>
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<h2>Latest posts</h2>
|
||||
{% if articles | length > 0 %}
|
||||
<ul>
|
||||
{% for article in articles %}
|
||||
<li>
|
||||
<a href="/blog/{{ article.slug }}">{{ article.title }}</a>
|
||||
{% if article.excerpt %}<p>{{ article.excerpt }}</p>{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>No published posts yet.</p>
|
||||
{% endif %}
|
||||
</section>
|
||||
<section class="pt-4">
|
||||
{% if articles | length > 0 %}
|
||||
<div class="grid gap-4">
|
||||
{% for article in articles %}
|
||||
<article class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<h2 class="card-title text-base">
|
||||
<a href="/blog/{{ article.slug }}">{{ article.title }}</a>
|
||||
</h2>
|
||||
<span class="badge">Post</span>
|
||||
</div>
|
||||
{% if article.excerpt %}
|
||||
<p class="text-sm leading-relaxed opacity-80">{{ article.excerpt }}</p>
|
||||
{% endif %}
|
||||
<div class="pt-2">
|
||||
<a href="/blog/{{ article.slug }}" class="btn btn-neutral btn-sm">Read</a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body text-center">
|
||||
<p class="font-medium">No published posts yet.</p>
|
||||
<p class="text-sm opacity-70">Check back later.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
@@ -3,8 +3,21 @@
|
||||
{% block title %}{{ page.title }}{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<article>
|
||||
<h1>{{ page.title }}</h1>
|
||||
<div>{{ page.content | linebreaksbr | safe }}</div>
|
||||
<article class="space-y-2">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">{{ page.title }}</h1>
|
||||
<p class="text-sm opacity-70">About this site.</p>
|
||||
</div>
|
||||
{% if logged_in_admin %}
|
||||
<a href="/admin/about" class="btn btn-ghost btn-sm">Edit page</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="leading-relaxed whitespace-pre-line">{{ page.content }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
{% endblock content %}
|
||||
|
||||
Reference in New Issue
Block a user