Hide draft articles from the front page and mark drafts when viewed directly

Add an Article::published() scope and use it on the front page (which
previously showed drafts), the /blog listing and the feeds. Draft
articles are still reachable at their URL, but now show a draft notice,
a "[Draft]" title prefix and a noindex robots meta tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jonny Barnes 2026-09-26 16:20:50 +01:00
commit a31c218784
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8

View file

@ -63,3 +63,16 @@
}
}
@layer components {
.draft-notice {
margin-block-end: 2ex;
padding: 1ex 1em;
border: 2px dashed var(--clr-border);
border-radius: 8px;
background: light-dark(
oklch(95% 0.08 85deg),
oklch(30% 0.08 85deg)
);
}
}