Fix 500 error on verse pages

- Fix verse.html to use correct variable name (verse_text instead of verse.text)
- Add safety check for undefined verse_text
- Temporarily disable Schema.org structured data due to JSON escaping issues
- Fix OpenGraph description to use correct template variable

This resolves the 500 Internal Server Error on verse pages like /book/Jude/chapter/1/verse/9

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-23 22:19:54 -05:00
parent 99bfac90c0
commit fb95a0fed6
2 changed files with 3 additions and 61 deletions
+1 -34
View File
@@ -7,40 +7,7 @@
{% block og_description %}{{ guide.description }}{% endblock %}
{% block structured_data %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "{{ guide.title }}",
"description": "{{ guide.description }}",
"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 Study"
},
"hasPart": [
{% for section in guide.sections %}
{
"@type": "WebPageElement",
"name": "{{ section.title }}",
"text": "{{ section.content[:200] | replace('"', '\\"') }}..."
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}
</script>
<!-- Schema.org structured data temporarily disabled -->
{% endblock %}
{% block head %}
+2 -27
View File
@@ -4,35 +4,10 @@
{% block og_type %}article{% endblock %}
{% block og_title %}{{ book }} {{ chapter }}:{{ verse_num }} - KJV Bible{% endblock %}
{% block og_description %}{{ verse.text[:150] }}...{% endblock %}
{% block og_description %}{{ verse_text[:150] if verse_text else '' }}...{% endblock %}
{% block structured_data %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "{{ book }} {{ chapter }}:{{ verse_num }}",
"articleBody": "{{ verse.text | replace('"', '\\"') }}",
"author": {
"@type": "Organization",
"name": "KJV Study"
},
"publisher": {
"@type": "Organization",
"name": "KJV Study",
"url": "https://kjvstudy.org"
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://kjvstudy.org/book/{{ book }}/chapter/{{ chapter }}/verse/{{ verse_num }}"
},
"isPartOf": {
"@type": "Book",
"name": "{{ book }}",
"@id": "https://kjvstudy.org/book/{{ book }}"
}
}
</script>
<!-- Schema.org structured data temporarily disabled -->
{% endblock %}
{% block head %}