some simple UI to make it work
This commit is contained in:
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user