Files
kennethreitz cc1c585c57 Security, performance, and quality improvements across the site
Security:
- Add path traversal protection to serve_data_file and og_image routes
- Bound OG image cache to 256 entries to prevent memory growth

Performance:
- Pre-build legacy URL lookup tables at startup instead of rglob on every 404
- Extract _generate_pdf helper, eliminating duplicate PDF code

Templates:
- Add dark mode support to graph.html and error.html

Content:
- Remove third-person sidenotes from yoga-meditation.md, great-music.md,
  and idea_amplification essay
- Fix sidenote formatting in yoga-meditation.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 17:45:56 -04:00

57 lines
1.9 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 a { color: #60a5fa; }
body.dark-mode .error-page a:hover { color: #93c5fd; }
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 a { color: #60a5fa; }
.error-page a:hover { color: #93c5fd; }
.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;
}
</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>
<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 %}