Files
kennethreitz 1a312bd704 404 page: links inherit Tufte color instead of hardcoded blue
The error template forced #60a5fa on links in dark mode, so 404 links
went blue while the rest of the site uses Tufte inherit (text + underline).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 10:22:25 -04:00

80 lines
2.4 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ error_code }} — {{ title }}{% endblock %}
{% block extra_head %}
<style>
body.dark-mode .error-page h1 { color: #ccc; }
body.dark-mode .error-page p { color: #aaa; }
body.dark-mode .error-page ul li { color: #aaa; }
body.dark-mode .error-page .error-note { color: #777; border-top-color: #333; }
@media (prefers-color-scheme: dark) {
.error-page h1 { color: #ccc; }
.error-page p { color: #aaa; }
.error-page ul li { color: #aaa; }
.error-page .error-note { color: #777; border-top-color: #333; }
}
.error-note {
margin-top: 2em;
padding-top: 1em;
border-top: 1px solid #ddd;
font-style: italic;
color: #666;
font-size: 0.9em;
}
.error-suggestions {
list-style: none;
padding-left: 0;
}
.error-suggestions li {
display: flex;
align-items: center;
gap: 0.6rem;
padding: 0.25rem 0;
}
.suggestion-icon {
width: 18px;
height: 18px;
flex-shrink: 0;
}
</style>
{% endblock %}
{% block content %}
<article class="error-page">
<h1>{{ error_code }}</h1>
<section>
<p>{{ error_message }}</p>
<p>The page you're looking for has either moved, been renamed, or never existed in
the first place. This site has been through a few incarnations over the years — things
shift around. It happens.</p>
{% if suggestions %}
<p><strong>Were you looking for one of these?</strong></p>
<ul class="error-suggestions">
{% for s in suggestions %}
<li>{% if s.icon %}<img src="{{ s.icon }}" alt="" class="suggestion-icon">{% endif %}<a href="{{ s.url }}">{{ s.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
<p>Here are a few ways to find your way back:</p>
<ul>
<li><a href="/search">Search the site</a> — probably the quickest route.</li>
<li>Browse the <a href="/essays">essay archive</a> — something might catch your eye.</li>
<li>Head back to <a href="/">the homepage</a> and start fresh.</li>
</ul>
<p class="error-note">If you followed a link here from somewhere else, the content likely still exists — it may just live at a different address now.</p>
</section>
</article>
{% endblock %}