Templates adjustments

This commit is contained in:
Alphonse Paix
2025-09-19 20:07:38 +02:00
parent bb27ad024d
commit 44b2ce677a
7 changed files with 114 additions and 153 deletions

View File

@@ -1,34 +1,36 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}Not Found{% endblock %} {% block title %}404{% endblock %}
{% block content %} {% block content %}
<div class="max-w-4xl mx-auto text-center"> <div class="flex-1 flex items-center justify-center">
<div class="mb-8"> <div class="max-w-4xl mx-auto text-center">
<h1 class="text-4xl font-semibold text-gray-700 mb-4">404</h1> <div class="mb-8">
<h2 class="text-2xl font-semibold text-gray-500 mb-6">Not Found</h2> <h1 class="text-4xl font-semibold text-gray-700 mb-4">404</h1>
<p class="text-gray-600 mb-8 max-w-2xl mx-auto"> <h2 class="text-2xl font-semibold text-gray-500 mb-6">Not Found</h2>
Sorry, we couldn't find the page you're looking for. The page may have been moved, deleted, or the URL might be incorrect. <p class="text-gray-600 mb-8 max-w-2xl mx-auto">
</p> Sorry, we couldn't find the page you're looking for. The page may have been moved, deleted, or the URL might be incorrect.
<div class="flex flex-col sm:flex-row gap-4 justify-center items-center"> </p>
<a href="/" <div class="flex flex-col sm:flex-row gap-4 justify-center items-center">
class="bg-blue-600 text-white hover:bg-blue-700 px-6 py-3 rounded-md font-medium transition-colors flex items-center"> <a href="/"
<svg class="w-4 h-4 mr-2" class="bg-blue-600 text-white hover:bg-blue-700 px-6 py-3 rounded-md font-medium transition-colors flex items-center">
fill="none" <svg class="w-4 h-4 mr-2"
viewBox="0 0 24 24" fill="none"
stroke="currentColor"> viewBox="0 0 24 24"
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" /> stroke="currentColor">
</svg> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
Home </svg>
</a> Home
<a href="/posts" </a>
class="bg-white text-gray-700 hover:text-blue-600 hover:bg-blue-50 border border-gray-300 px-6 py-3 rounded-md font-medium transition-colors flex items-center"> <a href="/posts"
<svg class="w-4 h-4 mr-2" class="bg-white text-gray-700 hover:text-blue-600 hover:bg-blue-50 border border-gray-300 px-6 py-3 rounded-md font-medium transition-colors flex items-center">
fill="none" <svg class="w-4 h-4 mr-2"
viewBox="0 0 24 24" fill="none"
stroke="currentColor"> viewBox="0 0 24 24"
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z" /> stroke="currentColor">
</svg> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z" />
Read posts </svg>
</a> Read posts
</a>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -6,7 +6,8 @@
<meta name="keywords" content="newsletter, rust, axum, htmx" /> <meta name="keywords" content="newsletter, rust, axum, htmx" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title> <title>
{% block title %}zero2prod{% endblock %} {% block title %}{% endblock %}
- zero2prod
</title> </title>
<link href="/assets/css/main.css" rel="stylesheet" /> <link href="/assets/css/main.css" rel="stylesheet" />
<script src="/assets/js/htmx.min.js"></script> <script src="/assets/js/htmx.min.js"></script>
@@ -36,10 +37,10 @@
</div> </div>
</header> </header>
<div class="flex flex-1"> <div class="flex flex-1">
<main class="flex-1 lg:ml-0"> <main class="flex-1 lg:ml-0 flex flex-col py-8 px-4 sm:px-6 lg:px-8">
<div class="py-8 px-4 sm:px-6 lg:px-8"> <!-- <div class="flex-1 flex-col py-8 px-4 sm:px-6 lg:px-8"> -->
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> <!-- </div> -->
</main> </main>
</div> </div>
<footer class="bg-white border-t border-gray-200 mt-auto"> <footer class="bg-white border-t border-gray-200 mt-auto">

View File

@@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}zero2prod{% endblock %} {% block title %}zero2prod{% endblock %}
{% block content %} {% block content %}
<div class="min-h-[60vh] flex items-center justify-center"> <div class="flex-1 flex items-center justify-center">
<div class="max-w-md w-full space-y-8"> <div class="max-w-md w-full space-y-8">
<div class="text-center"> <div class="text-center">
<div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-green-100 mb-6"> <div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-green-100 mb-6">
@@ -13,10 +13,7 @@
</svg> </svg>
</div> </div>
<h1 class="text-3xl font-bold text-gray-900 mb-4">Subscription confirmed</h1> <h1 class="text-3xl font-bold text-gray-900 mb-4">Subscription confirmed</h1>
<p class="text-lg text-gray-600 mb-8"> <p class="text-lg text-gray-600 mb-8">Your email has been confirmed! You're all set to receive the latest updates.</p>
Your email has been confirmed! You're all set to receive our newsletter
updates.
</p>
</div> </div>
<div class="text-center"> <div class="text-center">
<a href="/" <a href="/"

View File

@@ -1,5 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}Dashboard - zero2prod{% endblock %} {% block title %}Dashboard{% endblock %}
{% block content %} {% block content %}
<div class="max-w-6xl mx-auto"> <div class="max-w-6xl mx-auto">
<div class="mb-8"> <div class="mb-8">
@@ -21,9 +21,6 @@
<div class="flex items-center"> <div class="flex items-center">
<div class="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center"> <div class="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center">
<svg class="w-6 h-6 text-blue-600" <svg class="w-6 h-6 text-blue-600"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24" viewBox="0 0 24 24"
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"

View File

@@ -1,118 +1,82 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}Home - zero2prod{% endblock %} {% block title %}Home{% endblock %}
{% block content %} {% block content %}
<div class="max-w-4xl mx-auto"> <div class="flex-1 flex items-center justify-center">
<div class="bg-gradient-to-r from-blue-600 to-indigo-700 rounded-lg shadow-lg text-white p-8 mb-8"> <div class="max-w-4xl mx-auto">
<div class="max-w-3xl"> <div class="bg-gradient-to-r from-blue-600 to-indigo-700 rounded-lg shadow-lg text-white p-8 mb-8">
<h1 class="text-4xl font-bold mb-4">zero2prod</h1> <div class="max-w-3xl">
<p class="text-xl text-blue-100 mb-6"> <h1 class="text-4xl font-bold mb-4">zero2prod</h1>
Welcome to my blog! Stay updated on my latest projects and <p class="text-xl text-blue-100 mb-6">
thoughts. Subscribe (and unsubscribe) at any time. Welcome to my blog! Stay updated on my latest projects and
</p> thoughts. Subscribe (and unsubscribe) at any time.
<div class="flex flex-col sm:flex-row gap-4"> </p>
<a href="#newsletter-signup" <div class="flex flex-col sm:flex-row gap-4">
class="bg-white text-blue-600 hover:bg-gray-100 font-semibold py-3 px-6 rounded-md transition-colors text-center"> <a href="#newsletter-signup"
Subscribe class="bg-white text-blue-600 hover:bg-gray-100 font-semibold py-3 px-6 rounded-md transition-colors text-center">
</a>
<a href="https://gitea.alphonsepaix.xyz/alphonse/zero2prod"
target="_blank"
class="border border-white text-white hover:bg-white hover:text-blue-600 font-semibold py-3 px-6 rounded-md transition-colors text-center">
View code
</a>
</div>
</div>
</div>
<div class="grid md:grid-cols-3 gap-6 mb-8">
<div class="bg-white rounded-lg shadow-md p-6 border border-gray-200">
<div class="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center mb-4">
<svg class="w-6 h-6 text-blue-600"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
</div>
<h3 class="text-lg font-semibold text-gray-900 mb-2">Idempotent</h3>
<p class="text-gray-600 text-sm">
Smart duplicate prevention ensures you'll never receive the same email
twice.
</p>
</div>
<div class="bg-white rounded-lg shadow-md p-6 border border-gray-200">
<div class="w-12 h-12 bg-green-100 rounded-lg flex items-center justify-center mb-4">
<svg class="w-6 h-6 text-green-600"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
</svg>
</div>
<h3 class="text-lg font-semibold text-gray-900 mb-2">Privacy first</h3>
<p class="text-gray-600 text-sm">
Zero spam, zero tracking, zero data sharing. Your email stays private
and secure. Unsubscribe at any time.
</p>
</div>
<div class="bg-white rounded-lg shadow-md p-6 border border-gray-200">
<div class="w-12 h-12 bg-purple-100 rounded-lg flex items-center justify-center mb-4">
<svg class="w-6 h-6 text-purple-600"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" />
</svg>
</div>
<h3 class="text-lg font-semibold text-gray-900 mb-2">Quality content</h3>
<p class="text-gray-600 text-sm">
Curated insights on Rust backend development, performance tips, and
production war stories.
</p>
</div>
</div>
<div id="newsletter-signup"
class="bg-white rounded-lg shadow-md p-8 border border-gray-200">
<div class="max-w-2xl mx-auto text-center">
<h2 class="text-2xl font-bold text-gray-900 mb-4">Stay updated</h2>
<p class="text-gray-600 mb-6">Subscribe to my newsletter to get the latest updates.</p>
<form hx-post="/subscriptions"
hx-target="#subscribe-messages"
hx-swap="innerHTML"
class="max-w-md mx-auto">
<div class="flex flex-col sm:flex-row gap-3">
<input type="email"
name="email"
placeholder="you@example.com"
required
class="flex-1 px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" />
<button type="submit"
class="bg-blue-600 text-white hover:bg-blue-700 font-medium py-3 px-6 rounded-md transition-colors">
Subscribe Subscribe
</button> </a>
<a href="https://gitea.alphonsepaix.xyz/alphonse/zero2prod"
target="_blank"
class="border border-white text-white hover:bg-white hover:text-blue-600 font-semibold py-3 px-6 rounded-md transition-colors text-center">
View code
</a>
</div> </div>
<div id="subscribe-messages" class="mt-4"></div> </div>
</form>
</div> </div>
</div> <div class="grid md:grid-cols-2 gap-6 mb-8">
<div class="mt-8 bg-gray-50 rounded-lg p-6"> <div class="bg-white rounded-lg shadow-md p-6 border border-gray-200">
<h3 class="text-lg font-semibold text-gray-900 mb-4 text-center">Stats</h3> <div class="w-12 h-12 bg-green-100 rounded-lg flex items-center justify-center mb-4">
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 text-center"> <svg class="w-6 h-6 text-green-600"
<div> fill="none"
<div class="text-2xl font-bold text-blue-600" id="subscriber-count">2</div> viewBox="0 0 24 24"
<div class="text-sm text-gray-600">subscribers</div> stroke="currentColor">
</div> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
<div> </svg>
<div>
<div class="text-2xl font-bold text-orange-600">23</div>
<div class="text-sm text-gray-600">emails sent</div>
</div> </div>
<h3 class="text-lg font-semibold text-gray-900 mb-2">Privacy first</h3>
<p class="text-gray-600 text-sm">
Zero spam, zero tracking, zero data sharing. Your email stays private
and secure. Unsubscribe at any time.
</p>
</div> </div>
<div> <div class="bg-white rounded-lg shadow-md p-6 border border-gray-200">
<div class="text-2xl font-bold text-green-600">0</div> <div class="w-12 h-12 bg-purple-100 rounded-lg flex items-center justify-center mb-4">
<div class="text-sm text-gray-600">email opened</div> <svg class="w-6 h-6 text-purple-600"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" />
</svg>
</div>
<h3 class="text-lg font-semibold text-gray-900 mb-2">Quality content</h3>
<p class="text-gray-600 text-sm">
Curated insights on Rust backend development, performance tips, and
production war stories.
</p>
</div> </div>
<div> </div>
<div class="text-2xl font-bold text-purple-600">3</div> <div id="newsletter-signup"
<div class="text-sm text-gray-600">issues delivered</div> class="bg-white rounded-lg shadow-md p-8 border border-gray-200">
<div class="max-w-2xl mx-auto text-center">
<h2 class="text-2xl font-bold text-gray-900 mb-4">Stay updated</h2>
<p class="text-gray-600 mb-6">Subscribe to my newsletter to get the latest updates.</p>
<form hx-post="/subscriptions"
hx-target="#subscribe-messages"
hx-swap="innerHTML"
class="max-w-md mx-auto">
<div class="flex flex-col sm:flex-row gap-3">
<input type="email"
name="email"
placeholder="you@example.com"
required
class="flex-1 px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" />
<button type="submit"
class="bg-blue-600 text-white hover:bg-blue-700 font-medium py-3 px-6 rounded-md transition-colors">
Subscribe
</button>
</div>
<div id="subscribe-messages" class="mt-4"></div>
</form>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,5 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}{{ post.title }} - zero2prod{% endblock %} {% block title %}{{ post.title }}{% endblock %}
{% block content %} {% block content %}
<div class="max-w-4xl mx-auto"> <div class="max-w-4xl mx-auto">
<article class="bg-white rounded-lg shadow-md border border-gray-200"> <article class="bg-white rounded-lg shadow-md border border-gray-200">
@@ -36,7 +36,7 @@
<div class="prose prose-lg prose-blue max-w-none">{{ post.content | safe }}</div> <div class="prose prose-lg prose-blue max-w-none">{{ post.content | safe }}</div>
</div> </div>
</article> </article>
<div class="mt-12 bg-gradient-to-r from-blue-600 to-indigo-700 rounded-lg shadow-lg text-white p-8 text-center"> <div class="mt-8 bg-gradient-to-r from-blue-600 to-indigo-700 rounded-lg shadow-lg text-white p-8 text-center">
<h3 class="text-2xl font-bold mb-2">Enjoyed this post?</h3> <h3 class="text-2xl font-bold mb-2">Enjoyed this post?</h3>
<p class="text-blue-100 mb-4">Subscribe to my newsletter for more insights on Rust backend development.</p> <p class="text-blue-100 mb-4">Subscribe to my newsletter for more insights on Rust backend development.</p>
<a href="/#newsletter-signup" <a href="/#newsletter-signup"

View File

@@ -1,5 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}Posts - zero2prod{% endblock %} {% block title %}Posts{% endblock %}
{% block content %} {% block content %}
<div class="max-w-4xl mx-auto"> <div class="max-w-4xl mx-auto">
<div class="mb-8"> <div class="mb-8">