From b9cbd513127254780ae59c8e17ab2c47eea301cb Mon Sep 17 00:00:00 2001
From: memdmp <memdmp@estrogen.zone>
Date: Wed, 14 Jan 2026 17:40:37 +0100
Subject: feat: start working on alpine early init blog post, do a bunch of
 other blog related stuff

---
 src/lib/blog/Post.svelte | 53 ++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 47 insertions(+), 6 deletions(-)

(limited to 'src/lib/blog/Post.svelte')

diff --git a/src/lib/blog/Post.svelte b/src/lib/blog/Post.svelte
index 057f62b..ed1b929 100644
--- a/src/lib/blog/Post.svelte
+++ b/src/lib/blog/Post.svelte
@@ -3,6 +3,9 @@
 </script>
 
 <script lang="ts">
+  import { dev } from '$app/environment';
+  import { page } from '$app/state';
+
   import { parsePostMetadata, type Post } from './Post';
 
   let {
@@ -16,6 +19,10 @@
   let meta = $derived(parsePostMetadata(post.metadata));
 
   let PostComp = $derived(post.default);
+
+  let ignorePublishedStatus = $derived(
+    page.url.searchParams.has('ignore-unpublished'),
+  );
 </script>
 
 <svelte:head>
@@ -23,14 +30,41 @@
   <meta name="description" content={meta.blurb} />
 </svelte:head>
 
+{#snippet unpublished()}
+  <div
+    class="p-4 rounded-lg bg-neutral-950 border-accent-primary border-[1.8px] my-4 sticky top-4 z-50"
+  >
+    <h1 class="text-xl mb-2">Unpublished</h1>
+    <p class="my-1.5 leading-5">
+      This article has either not yet been published or has been retracted.<br
+      />
+      This could be due to being unfinished, factual errors, bad formulations, pending
+      significant corrections, or any number of other reasons.
+    </p>
+    {#if !ignorePublishedStatus && dev}
+      <p class="mt-1 5">
+        <a
+          href={new URL('?ignore-unpublished=+', page.url).href}
+          class="quicklink">Ignore and read anyway</a
+        >
+      </p>
+    {:else if ignorePublishedStatus}
+      <p class="mt-1.5">Here be dragons.</p>
+    {/if}
+  </div>
+{/snippet}
+
 <div class="flex justify-center">
   <div class="max-w-2xl w-full">
     <h1 class="font-space-grotesk text-5xl mt-8 mb-4">
-      <span class="text-accent-primary select-none">:&nbsp;</span
-      >{meta.title}<span class="text-accent-primary select-none">;</span>
+      <span class="select-none"
+        ><span class="text-red-400">❯ </span> less
+        <span class="text-red-400">'</span></span
+      >{meta.title}<span class="text-accent-primary select-none">';</span>
     </h1>
     <p class="my-4 font-genericmono flex gap-1 md:gap-2 flex-wrap">
-      <a href={encodeURI(`../`)} class="quicklink">../</a>{#if filename}<span
+      <a href={encodeURI(`../`)} class="quicklink">../</a
+      >{#if filename && (meta.published || ignorePublishedStatus || dev)}<span
           class="select-none">▒</span
         ><a
           href={encodeURI(
@@ -45,8 +79,15 @@
         .toISOString()
         .split('T')[0]}
     </p>
-    <article id="postmd">
-      <PostComp />
-    </article>
+    {#if meta.published || ignorePublishedStatus}
+      {#if !meta.published}
+        {@render unpublished()}
+      {/if}
+      <article id="postmd">
+        <PostComp />
+      </article>
+    {:else}
+      {@render unpublished()}
+    {/if}
   </div>
 </div>
-- 
cgit v1.2.3

