diff options
| author | Dennis Fink | 2026-11-04 19:46:20 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-04 19:46:20 +0100 |
| commit | de94696ed7428311c9832d2f0d55ee1d2d87a196 (patch) | |
| tree | 977eabb58af68a84ed934af1d511b4109aec7bcc | |
| parent | f284b9ad986a33e4121eb40a0fb3106ac052a984 (diff) | |
| download | dennisfink.me-de94696ed7428311c9832d2f0d55ee1d2d87a196.tar.gz dennisfink.me-de94696ed7428311c9832d2f0d55ee1d2d87a196.zip | |
Add custom 404 error page
This adds a dedicated 404 page with a playful message that reflects the
blog's title and tagline, along with a colourful gradient heading and
animated thinking dots.
It also provides reduced-motion support, excludes the page from search
engine and Pagefind indexing, and directs visitors to the site's
navigation and search.
Diffstat (limited to '')
| -rw-r--r-- | assets/static/css/404.css | 65 | ||||
| -rw-r--r-- | content/404.html/contents.lr | 5 | ||||
| -rw-r--r-- | templates/404.html | 29 |
3 files changed, 99 insertions, 0 deletions
diff --git a/assets/static/css/404.css b/assets/static/css/404.css new file mode 100644 index 0000000..a0ee30f --- /dev/null +++ b/assets/static/css/404.css @@ -0,0 +1,65 @@ +@charset "UTF-8"; + +article { + text-align: center; + + > p:first-of-type { + margin: 0; + font-size: clamp(6rem, 28vw, 13rem); + font-weight: 700; + line-height: 1; + letter-spacing: -0.04em; + background: linear-gradient( + to right, + var(--red), + var(--orange), + var(--yellow), + var(--green), + var(--cyan), + var(--blue), + var(--magenta), + var(--pink) + ); + -webkit-background-clip: text; + background-clip: text; + color: transparent; + } + + > p:last-of-type { + color: var(--dim-foreground); + font-size: 0.85rem; + width: 100%; + max-inline-size: inherit; + } + + .dots span { + opacity: 0.2; + animation: thinking 1.4s infinite; + + &:nth-child(2) { + animation-delay: 0.2s; + } + + &:nth-child(3) { + animation-delay: 0.4s; + } + } +} + +@keyframes thinking { + 0%, + 80%, + 100% { + opacity: 0.2; + } + 40% { + opacity: 1; + } +} + +@media (prefers-reduced-motion: reduce) { + .dots span { + animation: none; + opacity: 1; + } +} diff --git a/content/404.html/contents.lr b/content/404.html/contents.lr new file mode 100644 index 0000000..4ac5155 --- /dev/null +++ b/content/404.html/contents.lr @@ -0,0 +1,5 @@ +_model: none +--- +_template: 404.html +--- +_discoverable: no diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..5328908 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} + +{% set pagefind_body = false %} + +{% block meta %} + {{ super() }} + <meta name="robots" content="noindex"> +{% endblock %} + +{% block styles %} + {{ super() }} + <link rel="stylesheet" href="{{ '/static/css/404.css' | asseturl }}"> +{% endblock %} + +{% block content %} + <article> + <p class="center"aria-hidden="true">404</p> + <h2 class="center"> + <span class="visually-hidden">Error 404:</span> + This one didn’t linger + </h2> + <p class="center"> + <em>Personal notes on things that linger</em> — but this page isn’t one + of them. Maybe it never existed, maybe it moved, or maybe the URL has a + typo. I’m still thinking about which<span class="dots" aria-hidden="true"><span>.</span><span>.</span><span>.</span></span> + </p> + <p class="center">The menu and the search up top will know more.</p> + </article> +{% endblock %} |
