Files
kennethreitzandClaude Fable 5 94472e053a Site-wide design sweep: every remaining page on the system
Soup up the book landing pages (Joel et al.): Old/New Testament kicker,
letterspaced-caps book title matching the chapter pages, gold-tipped
Chapters heading, and key verses as gilt scripture plates with bronze
references and quiet significance notes.

Then a full sweep of the 32 remaining templates, applying the shared
patterns (gold-tipped small-caps apparatus headings, elevated cards,
chip buttons, gilt scripture plates, bronze micro-labels, token-only
colors, dark mode from tokens alone):

- about, about_claude, accessibility (system TOC cards, gilt CTA plate)
- resources, resource_index (elevated cards, bronze counts; fixed a
  featured-card style built on raw gold hex)
- names_of_god, tetragrammaton (scripture plates, chip actions)
- biblical_angels, biblical_covenants, biblical_festivals
- biblical_prophets, twelve_apostles, women_of_the_bible,
  fruits_of_spirit
- parables, interlinear_landing
- family_tree_person, family_tree_search (muted gender inks, gold for
  the messianic line)
- family_tree_ancestors, _descendants, _generation, _lineage
- search (scripture-plate results, gold-washed <mark> highlights),
  stars (star/gilt tokens), stats (stat-card grids in old-style
  numerals)
- commentary_index, cross_references_index (in-place TOC variants),
  error (404/500 rebuilt as a framed plate with the lost-sheep parable
  rubricated — Luke 15:4)
- reading_plan_detail (accent progress UI), topic_detail (scripture
  plates), strongs_language_index, stories_kids_index (~190 lines of
  purple dark-mode CSS removed)

Also fixed the last stragglers the sweep verifier found: raw #4a7c59
JS outlines in story_detail and the shared tree keyboard-nav partial,
and an undefined --border-color-light variable in stories_index.

All 976 tests pass; data validation 9/9; every template compiles.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 00:58:22 -04:00

548 lines
17 KiB
HTML

{% extends "base.html" %}
{% from "macros/seo.html" import breadcrumb_jsonld %}
{% block title %}{{ story.title }} - Bible Stories - KJV Study{% endblock %}
{% block description %}{{ story.description }}{% endblock %}
{% block og_type %}article{% endblock %}
{% block og_title %}{{ story.title }} - Bible Story{% endblock %}
{% block og_description %}{{ story.description }}{% endblock %}
{% block og_image %}https://kjvstudy.org/og/story/{{ story.slug }}.png{% endblock %}
{% block structured_data %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": {{ story.title | tojson }},
"description": {{ story.description | tojson }},
"author": {
"@type": "Organization",
"name": "KJV Study"
},
"publisher": {
"@type": "Organization",
"name": "KJV Study",
"url": "https://kjvstudy.org"
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://kjvstudy.org{{ request.url.path }}"
},
"about": {
"@type": "Thing",
"name": "Bible Story"
}
}
</script>
{{ breadcrumb_jsonld([
('Home', 'https://kjvstudy.org'),
('Bible Stories', 'https://kjvstudy.org/stories'),
(story.title, none),
]) }}
{% endblock %}
{% block head %}
<style>
/* Narrative column — wider than tufte's 55% default */
section > p {
width: 100%;
max-width: 46rem;
}
/* Story header */
.story-header {
margin-bottom: 2rem;
}
.story-header .category-link {
font-size: 0.78rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.22em;
color: var(--bronze) !important;
text-decoration: none;
border-bottom: none;
}
.story-header .category-link:hover {
text-decoration: underline;
}
.story-header h1 {
margin: 0.5rem 0;
}
.story-header .description {
font-size: 1.2rem;
color: var(--text-secondary, #555);
line-height: 1.6;
max-width: 55ch;
}
.story-actions {
display: flex;
gap: 0.75rem;
margin-top: 2rem;
}
.action-btn {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
font-size: 0.9rem;
color: var(--text-secondary);
background: var(--bg-elevated);
border: 1px solid var(--border-color-dark);
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
text-decoration: none;
}
.action-btn:hover {
background: var(--accent-softer);
border-color: var(--accent);
color: var(--accent-strong);
text-decoration: none;
}
.action-btn svg {
width: 16px;
height: 16px;
}
.action-btn.playing {
background: var(--accent-fill);
color: var(--on-accent);
border-color: var(--accent-fill);
}
/* Story metadata grid */
.story-meta {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
padding: 1.5rem 1.75rem;
background: var(--bg-elevated);
border: 1px solid var(--border-color-dark);
border-radius: 8px;
}
.meta-section h4 {
margin: 0 0 0.5rem 0;
font-size: 0.72rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.16em;
color: var(--bronze);
}
.meta-section ul {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
}
.meta-section li {
margin: 0;
font-size: 0.95rem;
}
.meta-section .scripture-ref {
display: inline-block;
padding: 0.2rem 0.65rem;
background: var(--bg-color);
border: 1px solid var(--border-color-dark) !important;
border-radius: 999px;
font-size: 0.85rem;
color: var(--text-color);
transition: all 0.15s;
}
.meta-section .scripture-ref:hover {
border-color: var(--accent) !important;
color: var(--accent-strong);
background: var(--accent-softer);
}
/* Ledger dividers between the columns on wide screens */
@media (min-width: 768px) {
.meta-section + .meta-section {
border-left: 1px solid var(--border-color);
padding-left: 1.5rem;
}
}
.meta-section .tag {
display: inline-block;
padding: 0.2rem 0.65rem;
margin: 0.2rem 0.2rem 0.2rem 0;
border-radius: 999px;
font-size: 0.85rem;
border: 1px solid var(--border-color-dark);
}
.meta-section .tag.character {
background: var(--accent-softer);
color: var(--accent-strong);
}
.meta-section .tag.theme {
background: var(--gold-soft);
color: var(--bronze);
}
/* Story divider */
hr.story-divider {
border: 0;
height: 0;
text-align: center;
margin: 2.5rem 0;
}
hr.story-divider::before {
content: "\2042"; /* asterism */
font-size: 1.4rem;
letter-spacing: 0.6em;
color: var(--gold);
}
/* Kids callout */
.kids-callout {
background: var(--accent-softer);
border-left: 3px solid var(--accent);
padding: 1.5rem 2rem;
margin: 2.5rem 0;
border-radius: 0 8px 8px 0;
}
.kids-callout h3 {
margin: 0 0 0.5rem 0;
color: var(--accent-strong) !important;
font-size: 1.1rem;
font-style: normal;
}
.kids-callout p {
margin: 0;
color: var(--text-secondary);
}
.kids-callout a {
color: var(--accent-strong) !important;
font-weight: 600;
}
/* Story navigation */
.story-nav {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 3rem;
padding-top: 1.5rem;
border-top: 1px solid var(--border-color, #ddd);
gap: 1rem;
}
.story-nav .nav-prev,
.story-nav .nav-next {
flex: 1;
max-width: 40%;
}
.story-nav .nav-prev {
text-align: left;
}
.story-nav .nav-next {
text-align: right;
}
.story-nav .nav-center {
text-align: center;
}
.story-nav .nav-label {
display: block;
font-size: 0.68rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.16em;
color: var(--bronze);
margin-bottom: 0.25rem;
}
.story-nav .nav-title {
font-size: 0.95rem;
color: var(--link-color);
text-decoration: none;
}
.story-nav .nav-title:hover {
text-decoration: underline;
}
.story-nav .nav-disabled {
color: var(--text-secondary, #ccc);
}
/* Print styles */
@media print {
.story-meta,
.kids-callout,
.story-nav,
.story-actions {
display: none;
}
.story-header .category-link {
display: none;
}
h1 {
font-size: 1.8rem;
margin-bottom: 0.5rem;
}
.story-header .description {
font-size: 1rem;
margin-bottom: 1.5rem;
}
section p {
font-size: 11pt;
line-height: 1.6;
}
}
/* Large font mode */
[data-font-size="large"] .story-header .description {
font-size: 1.5rem;
}
[data-font-size="large"] .meta-section h4 {
font-size: 1rem;
}
[data-font-size="large"] .meta-section li {
font-size: 1.2rem;
}
[data-font-size="large"] .meta-section .tag {
font-size: 1.05rem;
padding: 0.3rem 0.75rem;
}
[data-font-size="large"] .kids-callout h3 {
font-size: 1.3rem;
}
[data-font-size="large"] .kids-callout p {
font-size: 1.15rem;
}
[data-font-size="large"] .action-btn {
font-size: 1.1rem;
padding: 0.6rem 1.2rem;
}
[data-font-size="large"] .story-nav .nav-title {
font-size: 1.15rem;
}
</style>
{% endblock %}
{% block content %}
<article>
<header class="story-header">
<a href="/stories#{{ story.category_slug }}" class="category-link">{{ story.category_name }}</a>
<h1>{{ story.title }}</h1>
<p class="description">{{ story.description }}</p>
</header>
<div class="story-meta">
<div class="meta-section">
<h4>Scripture</h4>
<ul>
{% for verse in story.verses %}
{% set ref_parts = verse.split(' ') %}
{% if ref_parts|length >= 2 %}
{% set chapter_verse = ref_parts[-1] %}
{% set book = ' '.join(ref_parts[:-1]) %}
{% if ':' in chapter_verse %}
{% set chapter = chapter_verse.split(':')[0] %}
{% set verse_part = chapter_verse.split(':')[1] %}
{% if '-' in verse_part %}
<li><a href="/book/{{ book }}/chapter/{{ chapter }}#verse-{{ verse_part }}" class="scripture-ref">{{ verse }}</a></li>
{% else %}
<li><a href="/book/{{ book }}/chapter/{{ chapter }}#verse-{{ verse_part }}" class="scripture-ref">{{ verse }}</a></li>
{% endif %}
{% elif '-' in chapter_verse %}
{% set chapter = chapter_verse.split('-')[0] %}
<li><a href="/book/{{ book }}/chapter/{{ chapter }}" class="scripture-ref">{{ verse }}</a></li>
{% else %}
<li><a href="/book/{{ book }}/chapter/{{ chapter_verse }}" class="scripture-ref">{{ verse }}</a></li>
{% endif %}
{% else %}
<li class="scripture-ref">{{ verse }}</li>
{% endif %}
{% endfor %}
</ul>
</div>
<div class="meta-section">
<h4>Key Characters</h4>
<div>
{% for character in story.characters %}
<span class="tag character">{{ character }}</span>
{% endfor %}
</div>
</div>
<div class="meta-section">
<h4>Themes</h4>
<div>
{% for theme in story.themes %}
<span class="tag theme">{{ theme }}</span>
{% endfor %}
</div>
</div>
</div>
<hr class="story-divider">
<section>
{% for paragraph in story.narrative.split('\n\n') %}
{% if loop.first %}
<p><span class="newthought">{{ paragraph.split(' ')[:3] | join(' ') }}</span> {{ paragraph.split(' ')[3:] | join(' ') }}</p>
{% else %}
<p>{{ paragraph }}</p>
{% endif %}
{% endfor %}
</section>
<aside class="kids-callout">
<h3>Reading with Children?</h3>
<p>This story is also available in a kid-friendly version: <a href="/stories/{{ story.slug }}/kids">{{ story.kids_title }}</a> — written with simpler language and engaging narration perfect for young readers or family devotions.</p>
</aside>
<div class="story-actions">
<button class="action-btn listen-btn" id="story-listen-btn">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" />
</svg>
Listen
</button>
<a href="/stories/{{ story.slug }}/pdf" class="action-btn">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
Download PDF
</a>
</div>
</article>
<nav class="story-nav">
<div class="nav-prev">
{% if prev_story %}
<span class="nav-label">Previous Story</span>
<a href="/stories/{{ prev_story.slug }}" class="nav-title">← {{ prev_story.title }}</a>
{% else %}
<span class="nav-label">Previous Story</span>
<span class="nav-disabled">← No previous story</span>
{% endif %}
</div>
<div class="nav-center">
<a href="/stories" class="nav-title">All Stories</a>
</div>
<div class="nav-next">
{% if next_story %}
<span class="nav-label">Next Story</span>
<a href="/stories/{{ next_story.slug }}" class="nav-title">{{ next_story.title }} →</a>
{% else %}
<span class="nav-label">Next Story</span>
<span class="nav-disabled">No next story →</span>
{% endif %}
</div>
</nav>
<script>
(function() {
// Listen button - read story aloud
var listenBtn = document.getElementById('story-listen-btn');
var isListening = false;
if (listenBtn) {
listenBtn.addEventListener('click', function() {
if (isListening) {
if (window.KJVSpeech) window.KJVSpeech.stop();
listenBtn.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" /></svg> Listen';
isListening = false;
return;
}
// Gather story text from paragraphs
var paragraphs = document.querySelectorAll('article section p');
var text = Array.from(paragraphs).map(function(p) {
return p.textContent.trim();
}).join('. ');
if (window.KJVSpeech && text) {
window.KJVSpeech.speak(text);
listenBtn.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z" /></svg> Stop';
isListening = true;
}
});
}
// Collect paragraphs, kids callout, and action buttons for up/down navigation (skip story meta so speech focuses on narrative)
var elements = Array.from(document.querySelectorAll('article section p, .kids-callout, .story-actions .action-btn'));
// Find the index of the first paragraph (to start selection there)
var firstParagraphIndex = elements.findIndex(function(el) { return el.tagName === 'P'; });
var selectedIndex = -1;
function selectElement(index) {
// Remove previous selection
if (selectedIndex >= 0 && selectedIndex < elements.length) {
elements[selectedIndex].style.outline = '';
elements[selectedIndex].style.outlineOffset = '';
elements[selectedIndex].classList.remove('selected');
}
selectedIndex = Math.max(0, Math.min(index, elements.length - 1));
// Add selection to new element
elements[selectedIndex].style.outline = '2px solid var(--accent)';
elements[selectedIndex].style.outlineOffset = '8px';
elements[selectedIndex].classList.add('selected');
elements[selectedIndex].scrollIntoView({ behavior: 'auto', block: 'center' });
}
document.addEventListener('keydown', function(e) {
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
if (KJVNav.sidebarActive) return;
if (e.key === 'ArrowDown' || e.key === 'j') {
e.preventDefault();
if (KJVNav.isSelectionOffScreen(elements, selectedIndex)) {
selectElement(KJVNav.findFirstVisibleIndex(elements));
} else {
// Start at first paragraph, not metadata
selectElement(selectedIndex < 0 ? firstParagraphIndex : selectedIndex + 1);
}
} else if (e.key === 'ArrowUp' || e.key === 'k') {
e.preventDefault();
if (KJVNav.isSelectionOffScreen(elements, selectedIndex)) {
selectElement(KJVNav.findFirstVisibleIndex(elements));
} else if (selectedIndex <= 0) {
selectElement(0);
} else {
selectElement(selectedIndex - 1);
}
} else if (e.key === 'ArrowLeft' || e.key === 'h') {
e.preventDefault();
history.back();
} else if (e.key === 'ArrowRight' || e.key === 'l') {
e.preventDefault();
var nextLink = document.querySelector('.nav-next .nav-title');
if (nextLink) window.location.href = nextLink.href;
} else if (e.key === '[') {
e.preventDefault();
var prevLink = document.querySelector('.nav-prev .nav-title');
if (prevLink) window.location.href = prevLink.href;
} else if (e.key === ']') {
e.preventDefault();
var nextLink = document.querySelector('.nav-next .nav-title');
if (nextLink) window.location.href = nextLink.href;
} else if (e.key === 'Enter' && selectedIndex >= 0) {
e.preventDefault();
var el = elements[selectedIndex];
// Check if the element itself is a link (like PDF button)
if (el.tagName === 'A' && el.href) {
window.location.href = el.href;
} else {
var link = el.querySelector('a');
if (link) window.location.href = link.href;
}
} else if (e.key === 'Escape') {
e.preventDefault();
if (selectedIndex >= 0 && selectedIndex < elements.length) {
elements[selectedIndex].style.outline = '';
elements[selectedIndex].style.outlineOffset = '';
elements[selectedIndex].classList.remove('selected');
}
selectedIndex = -1;
}
});
})();
</script>
{% endblock %}