mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-10-24 14:29:14 +00:00
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>
628 lines
19 KiB
HTML
628 lines
19 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}
|
|
{% if status_code == 404 %}
|
|
Page Not Found - KJV Study
|
|
{% else %}
|
|
Error {{ status_code }} - KJV Study
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block description %}The requested page could not be found. Use our search to find Bible passages, topics, study guides, and more.{% endblock %}
|
|
|
|
{% block head %}
|
|
<style>
|
|
.error-page {
|
|
max-width: 46rem;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
/* The plate — double hairline frame, like the title page of the book */
|
|
.error-plate {
|
|
position: relative;
|
|
text-align: center;
|
|
padding: 3rem 2.5rem 2.75rem;
|
|
margin: 2.5rem 0 3rem;
|
|
background: var(--bg-elevated);
|
|
border: 1px solid var(--border-color-darker);
|
|
box-shadow: var(--shadow-soft);
|
|
}
|
|
|
|
.error-plate::before {
|
|
content: '';
|
|
position: absolute;
|
|
inset: 7px;
|
|
border: 1px solid var(--border-color-dark);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.error-code {
|
|
font-size: 5rem;
|
|
font-weight: 300;
|
|
color: var(--bronze);
|
|
line-height: 1;
|
|
margin: 0 0 0.75rem;
|
|
font-variant-numeric: oldstyle-nums;
|
|
letter-spacing: 0.08em;
|
|
}
|
|
|
|
.error-title {
|
|
font-size: 2.1rem;
|
|
font-weight: 400;
|
|
font-style: italic;
|
|
color: var(--text-strong);
|
|
margin: 0;
|
|
line-height: 1.25;
|
|
}
|
|
|
|
/* Gold ornament between title and verse */
|
|
.error-divider {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 1rem;
|
|
width: 240px;
|
|
margin: 1.75rem auto;
|
|
color: var(--gold);
|
|
font-size: 1.05rem;
|
|
}
|
|
|
|
.error-divider::before,
|
|
.error-divider::after {
|
|
content: '';
|
|
flex: 1;
|
|
height: 1px;
|
|
background: linear-gradient(to right, transparent, var(--border-color-darker));
|
|
}
|
|
|
|
.error-divider::after {
|
|
background: linear-gradient(to left, transparent, var(--border-color-darker));
|
|
}
|
|
|
|
/* Luke 15:4 — the words of Christ, rubricated */
|
|
.error-verse {
|
|
max-width: 34rem;
|
|
font-size: 1.15rem;
|
|
line-height: 1.9;
|
|
font-style: italic;
|
|
color: var(--rubric);
|
|
margin: 0 auto;
|
|
padding: 0;
|
|
border: none;
|
|
}
|
|
|
|
.error-verse-ref {
|
|
display: block;
|
|
margin-top: 1rem;
|
|
font-style: normal;
|
|
}
|
|
|
|
.error-verse-ref a {
|
|
font-size: 0.7rem;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.14em;
|
|
color: var(--bronze);
|
|
text-decoration: none;
|
|
border-bottom: 1px solid transparent;
|
|
}
|
|
|
|
.error-verse-ref a:hover {
|
|
color: var(--accent-strong);
|
|
border-bottom-color: var(--underline);
|
|
}
|
|
|
|
.error-explanation {
|
|
max-width: 34rem;
|
|
font-size: 1.15rem;
|
|
line-height: 1.8;
|
|
color: var(--text-secondary);
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.error-explanation p {
|
|
font-size: inherit;
|
|
line-height: inherit;
|
|
margin: 0;
|
|
}
|
|
|
|
.search-container {
|
|
margin: 3rem 0;
|
|
padding: 1.75rem 2rem;
|
|
background: var(--bg-elevated);
|
|
border: 1px solid var(--border-color-dark);
|
|
border-radius: 8px;
|
|
box-shadow: var(--shadow-soft);
|
|
}
|
|
|
|
/* Apparatus headings — small caps over a gold-tipped rule */
|
|
.search-container h2,
|
|
.helpful-links h2 {
|
|
position: relative;
|
|
font-size: 0.95rem !important;
|
|
font-weight: 600;
|
|
font-style: normal !important;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.18em;
|
|
color: var(--text-secondary) !important;
|
|
margin: 0 0 1.25rem;
|
|
padding-bottom: 0.6rem;
|
|
border-bottom: 1px solid var(--border-color);
|
|
}
|
|
|
|
.search-container h2::after,
|
|
.helpful-links h2::after {
|
|
content: '';
|
|
position: absolute;
|
|
left: 0;
|
|
bottom: -1px;
|
|
width: 2.75rem;
|
|
height: 1px;
|
|
background: var(--gold);
|
|
}
|
|
|
|
.search-box {
|
|
width: 100%;
|
|
padding: 0.75rem 1rem;
|
|
font-size: 1.05rem;
|
|
border: 1px solid var(--border-color-darker);
|
|
background: var(--bg-elevated);
|
|
color: var(--text-color);
|
|
font-family: inherit;
|
|
border-radius: 8px;
|
|
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
}
|
|
|
|
.search-box::placeholder {
|
|
font-style: italic;
|
|
color: var(--text-tertiary);
|
|
}
|
|
|
|
.search-box:focus {
|
|
outline: none;
|
|
border-color: var(--accent);
|
|
box-shadow: 0 0 0 3px var(--accent-soft);
|
|
}
|
|
|
|
.search-examples {
|
|
margin-top: 0.85rem;
|
|
font-size: 0.9rem;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.search-examples code {
|
|
background: var(--code-bg);
|
|
padding: 0.15rem 0.4rem;
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 4px;
|
|
font-size: 0.85rem;
|
|
}
|
|
|
|
.suggestions-section {
|
|
margin: 2rem 0;
|
|
padding: 1.25rem 1.5rem;
|
|
background: var(--gold-soft);
|
|
border-left: 3px solid var(--gold);
|
|
border-radius: 0 8px 8px 0;
|
|
}
|
|
|
|
.suggestions-section h3 {
|
|
font-size: 0.8rem;
|
|
font-weight: 600;
|
|
font-style: normal;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.14em;
|
|
margin: 0 0 0.75rem;
|
|
color: var(--bronze);
|
|
}
|
|
|
|
.suggestion-text {
|
|
margin: 0.5rem 0;
|
|
font-size: 1.05rem;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.suggestion-text a {
|
|
color: var(--accent-strong);
|
|
text-decoration: none;
|
|
font-weight: 600;
|
|
border-bottom: 1px solid transparent;
|
|
}
|
|
|
|
.suggestion-text a:hover {
|
|
border-bottom-color: var(--underline);
|
|
}
|
|
|
|
.helpful-links {
|
|
margin: 3rem 0;
|
|
}
|
|
|
|
.links-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
gap: 1rem;
|
|
}
|
|
|
|
.help-link {
|
|
padding: 1.1rem 1.25rem;
|
|
background: var(--bg-elevated);
|
|
border: 1px solid var(--border-color-dark);
|
|
border-radius: 8px;
|
|
text-decoration: none;
|
|
color: var(--text-color);
|
|
display: block;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.help-link:hover {
|
|
border-color: var(--accent);
|
|
transform: translateY(-2px);
|
|
box-shadow: var(--shadow-soft);
|
|
}
|
|
|
|
.help-link-title {
|
|
font-weight: 600;
|
|
margin-bottom: 0.25rem;
|
|
color: var(--text-strong);
|
|
transition: color 0.15s ease;
|
|
}
|
|
|
|
.help-link:hover .help-link-title {
|
|
color: var(--accent-strong);
|
|
}
|
|
|
|
.help-link-desc {
|
|
font-size: 0.9rem;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
/* Chip links home */
|
|
.go-back {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.75rem;
|
|
margin: 2.5rem 0;
|
|
}
|
|
|
|
.go-back a {
|
|
display: inline-block;
|
|
padding: 0.45rem 0.9rem;
|
|
background: var(--bg-elevated);
|
|
border: 1px solid var(--border-color-dark);
|
|
border-radius: 6px;
|
|
color: var(--text-secondary);
|
|
text-decoration: none;
|
|
font-size: 0.95rem;
|
|
transition: all 0.15s ease;
|
|
}
|
|
|
|
.go-back a:hover {
|
|
background: var(--accent-softer);
|
|
border-color: var(--accent);
|
|
color: var(--accent-strong);
|
|
}
|
|
|
|
.go-back a.go-back-home {
|
|
background: var(--accent-fill);
|
|
border-color: var(--accent-fill);
|
|
color: var(--on-accent);
|
|
}
|
|
|
|
.go-back a.go-back-home:hover {
|
|
background: var(--accent-fill-hover);
|
|
border-color: var(--accent-fill-hover);
|
|
color: var(--on-accent);
|
|
}
|
|
|
|
.error-plate .go-back {
|
|
justify-content: center;
|
|
margin: 2.25rem 0 0;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.error-plate {
|
|
padding: 2.25rem 1.25rem 2rem;
|
|
}
|
|
|
|
.error-code {
|
|
font-size: 3.5rem;
|
|
}
|
|
|
|
.error-title {
|
|
font-size: 1.6rem;
|
|
}
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<article class="error-page">
|
|
{% if status_code == 404 %}
|
|
<header class="error-plate">
|
|
<p class="error-code">404</p>
|
|
<h1 class="error-title">The Page You Seek Cannot Be Found</h1>
|
|
<div class="error-divider" aria-hidden="true">❦</div>
|
|
<blockquote class="error-verse">
|
|
What man of you, having an hundred sheep, if he lose one of them, doth not leave the ninety and nine in the wilderness, and go after that which is lost, until he find it?
|
|
<span class="error-verse-ref">
|
|
<a href="/book/Luke/chapter/15/verse/4">Luke 15:4</a>
|
|
</span>
|
|
</blockquote>
|
|
</header>
|
|
|
|
<div id="url-suggestions"></div>
|
|
|
|
<section class="search-container">
|
|
<h2>Search the Scriptures</h2>
|
|
<form action="/search" method="get" onsubmit="handleSearch(event)">
|
|
<input type="text"
|
|
name="q"
|
|
class="search-box"
|
|
placeholder="Search verses, topics, or enter a reference like 'John 3:16'"
|
|
autofocus>
|
|
</form>
|
|
<div class="search-examples">
|
|
Try: <code>John 3:16</code>, <code>faith</code>, <code>Psalm 23</code>, or <code>salvation</code>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="helpful-links">
|
|
<h2>Continue Your Study</h2>
|
|
<div class="links-grid">
|
|
<a href="/" class="help-link">
|
|
<div class="help-link-title">Browse Books</div>
|
|
<div class="help-link-desc">Old and New Testament</div>
|
|
</a>
|
|
<a href="/topics" class="help-link">
|
|
<div class="help-link-title">Topical Index</div>
|
|
<div class="help-link-desc">Study by subject</div>
|
|
</a>
|
|
<a href="/study-guides" class="help-link">
|
|
<div class="help-link-title">Study Guides</div>
|
|
<div class="help-link-desc">Theological essays</div>
|
|
</a>
|
|
<a href="/biblical-prophets" class="help-link">
|
|
<div class="help-link-title">Biblical Prophets</div>
|
|
<div class="help-link-desc">Messengers of God</div>
|
|
</a>
|
|
<a href="/biblical-angels" class="help-link">
|
|
<div class="help-link-title">Biblical Angels</div>
|
|
<div class="help-link-desc">Heavenly beings</div>
|
|
</a>
|
|
<a href="/biblical-covenants" class="help-link">
|
|
<div class="help-link-title">Biblical Covenants</div>
|
|
<div class="help-link-desc">God's promises</div>
|
|
</a>
|
|
</div>
|
|
</section>
|
|
|
|
<nav class="go-back">
|
|
<a href="javascript:history.back()">← Return to previous page</a>
|
|
<a href="/" class="go-back-home">Go to homepage</a>
|
|
</nav>
|
|
|
|
{% else %}
|
|
{# Other error codes #}
|
|
<header class="error-plate">
|
|
<p class="error-code">{{ status_code }}</p>
|
|
<h1 class="error-title">An Error Has Occurred</h1>
|
|
<div class="error-divider" aria-hidden="true">❦</div>
|
|
<section class="error-explanation">
|
|
<p>{{ detail or "An unexpected error occurred. Please try again or return to the homepage." }}</p>
|
|
</section>
|
|
<nav class="go-back">
|
|
<a href="javascript:history.back()">← Return to previous page</a>
|
|
<a href="/" class="go-back-home">Go to homepage</a>
|
|
</nav>
|
|
</header>
|
|
{% endif %}
|
|
</article>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const path = window.location.pathname;
|
|
const suggestionsDiv = document.getElementById('url-suggestions');
|
|
|
|
// Try to parse the URL and suggest corrections
|
|
const suggestions = [];
|
|
|
|
// Canonical KJV books
|
|
const bookNames = [
|
|
'Genesis', 'Exodus', 'Leviticus', 'Numbers', 'Deuteronomy',
|
|
'Joshua', 'Judges', 'Ruth', '1 Samuel', '2 Samuel', '1 Kings', '2 Kings',
|
|
'1 Chronicles', '2 Chronicles', 'Ezra', 'Nehemiah', 'Esther', 'Job',
|
|
'Psalms', 'Proverbs', 'Ecclesiastes', 'Song of Solomon',
|
|
'Isaiah', 'Jeremiah', 'Lamentations', 'Ezekiel', 'Daniel',
|
|
'Hosea', 'Joel', 'Amos', 'Obadiah', 'Jonah', 'Micah', 'Nahum',
|
|
'Habakkuk', 'Zephaniah', 'Haggai', 'Zechariah', 'Malachi',
|
|
'Matthew', 'Mark', 'Luke', 'John', 'Acts', 'Romans',
|
|
'1 Corinthians', '2 Corinthians', 'Galatians', 'Ephesians',
|
|
'Philippians', 'Colossians', '1 Thessalonians', '2 Thessalonians',
|
|
'1 Timothy', '2 Timothy', 'Titus', 'Philemon', 'Hebrews', 'James',
|
|
'1 Peter', '2 Peter', '1 John', '2 John', '3 John', 'Jude', 'Revelation'
|
|
];
|
|
|
|
// Apocryphal/non-canonical books (Easter eggs!)
|
|
const apocryphalBooks = {
|
|
'enoch': 'The Book of Enoch is not part of the Protestant canon, though it is referenced in <a href="/book/Jude/chapter/1/verse/14">Jude 1:14-15</a>: "Enoch also, the seventh from Adam, prophesied of these, saying, Behold, the Lord cometh with ten thousands of his saints."',
|
|
'tobit': 'The Book of Tobit is part of the Catholic Deuterocanon but not included in Protestant Bibles.',
|
|
'judith': 'The Book of Judith is part of the Catholic Deuterocanon but not included in Protestant Bibles.',
|
|
'wisdom': 'The Wisdom of Solomon is part of the Catholic Deuterocanon but not included in Protestant Bibles.',
|
|
'sirach': 'The Book of Sirach (Ecclesiasticus) is part of the Catholic Deuterocanon but not included in Protestant Bibles.',
|
|
'baruch': 'The Book of Baruch is part of the Catholic Deuterocanon but not included in Protestant Bibles.',
|
|
'maccabees': 'The Books of Maccabees are part of the Catholic Deuterocanon but not included in Protestant Bibles.',
|
|
'1maccabees': 'First Maccabees is part of the Catholic Deuterocanon but not included in Protestant Bibles.',
|
|
'2maccabees': 'Second Maccabees is part of the Catholic Deuterocanon but not included in Protestant Bibles.',
|
|
'thomas': 'The Gospel of Thomas is a Gnostic text not accepted as canonical by any major Christian tradition.',
|
|
'jasher': 'The Book of Jasher is mentioned in <a href="/book/Joshua/chapter/10/verse/13">Joshua 10:13</a> and <a href="/book/2 Samuel/chapter/1/verse/18">2 Samuel 1:18</a>, but the original text is lost. Modern versions are of disputed authenticity.',
|
|
'jubilees': 'The Book of Jubilees is considered canonical only by the Ethiopian Orthodox Church.'
|
|
};
|
|
|
|
// Common misspellings and their corrections
|
|
const commonMisspellings = {
|
|
'philipians': 'Philippians',
|
|
'philippeans': 'Philippians',
|
|
'collossians': 'Colossians',
|
|
'colosians': 'Colossians',
|
|
'thesselonians': 'Thessalonians',
|
|
'galations': 'Galatians',
|
|
'corintheans': 'Corinthians',
|
|
'ephesans': 'Ephesians',
|
|
'eclesiastes': 'Ecclesiastes',
|
|
'ecclesiates': 'Ecclesiastes',
|
|
'deutronomy': 'Deuteronomy',
|
|
'dueteronomy': 'Deuteronomy',
|
|
'levitcus': 'Leviticus',
|
|
'isiah': 'Isaiah',
|
|
'isaiah': 'Isaiah',
|
|
'jeremia': 'Jeremiah',
|
|
'ezekial': 'Ezekiel',
|
|
'revalation': 'Revelation',
|
|
'revelations': 'Revelation',
|
|
'psalm': 'Psalms',
|
|
'songs of solomon': 'Song of Solomon',
|
|
'song of songs': 'Song of Solomon'
|
|
};
|
|
|
|
// Check for apocryphal books first (must be in /book/ path)
|
|
const pathLower = path.toLowerCase();
|
|
if (pathLower.includes('/book/')) {
|
|
for (const [apocBook, explanation] of Object.entries(apocryphalBooks)) {
|
|
if (pathLower.includes('/book/' + apocBook) || pathLower.includes('/book/' + apocBook.replace(/\s/g, ''))) {
|
|
suggestions.push({
|
|
text: explanation,
|
|
url: null,
|
|
isInfo: true
|
|
});
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
// If no apocryphal book found, check for canonical books or misspellings
|
|
if (suggestions.length === 0) {
|
|
// Check for common misspellings
|
|
let correctedBook = null;
|
|
for (const [misspelling, correction] of Object.entries(commonMisspellings)) {
|
|
if (pathLower.includes(misspelling)) {
|
|
correctedBook = correction;
|
|
break;
|
|
}
|
|
}
|
|
|
|
// Check for book references in the URL (exact or corrected)
|
|
for (const book of bookNames) {
|
|
const bookToCheck = correctedBook || book;
|
|
if (pathLower.includes(bookToCheck.toLowerCase().replace(/\s/g, ''))) {
|
|
// Try to extract chapter and verse
|
|
const chapterMatch = path.match(/chapter[\/\-]?(\d+)/i);
|
|
const verseMatch = path.match(/verse[\/\-]?(\d+)/i);
|
|
|
|
if (correctedBook) {
|
|
// Show misspelling correction
|
|
if (chapterMatch) {
|
|
const chapter = chapterMatch[1];
|
|
if (verseMatch) {
|
|
const verse = verseMatch[1];
|
|
suggestions.push({
|
|
text: `Did you mean ${correctedBook} ${chapter}:${verse}?`,
|
|
url: `/book/${correctedBook}/chapter/${chapter}/verse/${verse}`
|
|
});
|
|
} else {
|
|
suggestions.push({
|
|
text: `Did you mean ${correctedBook} chapter ${chapter}?`,
|
|
url: `/book/${correctedBook}/chapter/${chapter}`
|
|
});
|
|
}
|
|
} else {
|
|
suggestions.push({
|
|
text: `Did you mean the book of ${correctedBook}?`,
|
|
url: `/book/${correctedBook}`
|
|
});
|
|
}
|
|
} else if (book === bookToCheck) {
|
|
// Exact match found
|
|
if (chapterMatch) {
|
|
const chapter = chapterMatch[1];
|
|
if (verseMatch) {
|
|
const verse = verseMatch[1];
|
|
suggestions.push({
|
|
text: `Did you mean ${book} ${chapter}:${verse}?`,
|
|
url: `/book/${book}/chapter/${chapter}/verse/${verse}`
|
|
});
|
|
} else {
|
|
suggestions.push({
|
|
text: `Did you mean ${book} chapter ${chapter}?`,
|
|
url: `/book/${book}/chapter/${chapter}`
|
|
});
|
|
}
|
|
} else {
|
|
suggestions.push({
|
|
text: `Did you mean the book of ${book}?`,
|
|
url: `/book/${book}`
|
|
});
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Check for common misspellings or old URLs
|
|
if (path.includes('/verse-of-the-day')) {
|
|
suggestions.push({
|
|
text: 'Looking for the Verse of the Day?',
|
|
url: '/'
|
|
});
|
|
}
|
|
|
|
if (path.includes('/search')) {
|
|
suggestions.push({
|
|
text: 'Try the search feature above',
|
|
url: null
|
|
});
|
|
}
|
|
|
|
// Display suggestions if any
|
|
if (suggestions.length > 0 && suggestionsDiv) {
|
|
let html = '<section class="suggestions-section"><h3>Perhaps You Were Looking For...</h3>';
|
|
for (const suggestion of suggestions) {
|
|
if (suggestion.url) {
|
|
html += `<p class="suggestion-text"><a href="${suggestion.url}">${suggestion.text}</a></p>`;
|
|
} else {
|
|
html += `<p class="suggestion-text">${suggestion.text}</p>`;
|
|
}
|
|
}
|
|
html += '</section>';
|
|
suggestionsDiv.innerHTML = html;
|
|
}
|
|
});
|
|
|
|
function handleSearch(event) {
|
|
event.preventDefault();
|
|
const query = event.target.querySelector('input[name="q"]').value.trim();
|
|
|
|
if (!query) return;
|
|
|
|
// Check if query looks like a verse reference (e.g., "John 3:16")
|
|
const versePattern = /^(\d?\s?[A-Za-z]+(?:\s+[A-Za-z]+)?)\s+(\d+)(?::(\d+))?$/;
|
|
const match = query.match(versePattern);
|
|
|
|
if (match) {
|
|
const book = match[1].trim();
|
|
const chapter = match[2];
|
|
const verse = match[3];
|
|
|
|
if (verse) {
|
|
window.location.href = `/book/${book}/chapter/${chapter}/verse/${verse}`;
|
|
} else {
|
|
window.location.href = `/book/${book}/chapter/${chapter}`;
|
|
}
|
|
} else {
|
|
// Regular search
|
|
window.location.href = `/search?q=${encodeURIComponent(query)}`;
|
|
}
|
|
}
|
|
</script>
|
|
{% endblock %}
|