some simple UI to make it work

This commit is contained in:
Priec
2026-05-17 17:46:04 +02:00
parent 0a36e8839c
commit 1d51a23bfb
10 changed files with 333 additions and 148 deletions

View File

@@ -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 %}