added admin control panel

This commit is contained in:
2026-03-25 12:08:55 +01:00
parent 2da31a2474
commit 311392bffa
7 changed files with 538 additions and 14 deletions

View File

@@ -63,4 +63,32 @@ function formatSlug(slug: string) {
<div class="prose prose-invert max-w-none" set:html={html} />
)}
</article>
<script>
if (localStorage.getItem('admin_token')) {
const editBtn = document.getElementById('edit-btn');
if (editBtn) {
editBtn.style.display = 'inline-flex';
}
}
</script>
</Layout>
1.5-5.5Z"/><path d="m15 5 4 4"/></svg>
Edit
</a>
</div>
)}
</header>
{error && (
<div class="text-red text-center py-12">
<h2 class="text-2xl font-bold mb-4">{error}</h2>
<a href="/" class="text-blue underline">Return home</a>
</div>
)}
{post && (
<div class="prose prose-invert max-w-none" set:html={html} />
)}
</article>
</Layout>