Commit Graph

8 Commits

Author SHA1 Message Date
kennethreitz 0132efbfbc Add red letter statistics script
Created comprehensive statistics script for analyzing the red letter
edition data (words of Jesus Christ).

Features:
- Total verse counts (full vs partial)
- Breakdown by book with percentages
- Testament distribution (Gospels vs Acts/Revelation)
- Longest continuous discourses (e.g., Sermon on the Mount)
- Notable discourse references

Usage: uv run python scripts/red_letter_stats.py

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 15:11:24 -05:00
kennethreitz 54e3b932d4 Fix verse commentary validator to allow apostrophes and verse ranges
Updated the VerseCommentary validation regex pattern to support:
- Apostrophes in book names (e.g., "Solomon's Song")
- Verse ranges (e.g., "Genesis 1:4-5")

This brings the validator in line with other validators in the codebase
and fixes failing data validation tests.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 14:48:32 -05:00
kennethreitz 801c8b93f0 Add script to show verse commentary coverage
Create utility script to track progress on enhanced verse commentary.
Displays statistics about which verses have enhanced JSON commentary
and provides various reporting options.

Features:
- Summary view showing books and verse counts
- Book-specific detail view
- Complete verse listing
- Detailed statistics including field completeness

Usage examples:
  python scripts/show_commentary_coverage.py              # Summary
  python scripts/show_commentary_coverage.py --book Genesis
  python scripts/show_commentary_coverage.py --list       # All verses
  python scripts/show_commentary_coverage.py --stats      # Detailed stats

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 13:05:21 -05:00
kennethreitz 46268749b1 Add script to generate Open Graph image
Standalone Python script to regenerate og-image.png with consistent Tufte-style branding. Can be run anytime to update the social media preview image.

Usage: python3 scripts/generate-og-image.py

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 12:26:45 -05:00
kennethreitz 3493c43144 Fix verse sitemap generation - suppress WeasyPrint warnings
The sitemap-verses.xml file was contaminated with WeasyPrint import
warnings, causing "Document is empty" errors in Google Search Console.

Fixes:
- Suppress stdout/stderr during imports to prevent warnings in output
- Add error handling to sitemap-verses endpoint
- Regenerate clean sitemap-verses.xml (6.3MB, 31,102 verses)

The file now starts with proper XML declaration instead of error messages.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 19:37:34 -05:00
kennethreitz e931dae83f Implement static verse sitemap for maximum SEO discoverability
Previously, verse URLs (31,102 pages) were excluded from the sitemap
to improve generation speed. This left SEO value on the table - Google
prioritizes URLs in sitemaps for crawling, and verse pages are 3-4
clicks deep, making discovery slow.

Solution: Static sitemap + sitemap index
-----------------------------------------
- Created generate_verse_sitemap.py to generate verse sitemap once
- Generated sitemap-verses.xml (6 MB, 31,102 verse URLs)
- Converted /sitemap.xml to a sitemap index
- Split into sitemap-main.xml (dynamic) and sitemap-verses.xml (static)

Benefits:
---------
- Zero runtime cost for verse sitemap (served as static file)
- Full SEO coverage of all 31k verse pages
- Google gets complete URL list immediately
- Main sitemap stays fast (no verse URL generation)
- CDN can cache verse sitemap indefinitely

Why this works:
---------------
Verse URLs are completely static - Genesis 1:1 will always be at the
same URL. The Bible hasn't changed in 2000+ years, so these URLs
never change. Generate once, commit to repo, infinite caching.

This trades "optimize build speed" for "optimize discoverability."
Build speed is a one-time cost; search rankings compound over time.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 19:22:39 -05:00
kennethreitz c226c4bbbf Add JSON schema validation for 66 book introduction files
This commit adds comprehensive validation for all book introduction files
in data/books/ using Pydantic models and JSON Schema.

Changes:
- Added BookIntroduction Pydantic model with nested models:
  - OutlineSection: Validates book outline sections
  - KeyTheme: Validates key themes with descriptions
  - KeyVerse: Validates key verses with references and text
- Added validate_all_books() function to validate all 66 book files
- Added validate_book_file() helper function
- Added --books CLI flag to validate book files separately
- Generated book_introduction.schema.json JSON Schema file
- Fixed KeyVerse model field name from 'verse' to 'reference'
- Added 4 new tests to validate book directory and all 66 books

All 66 book files now validate successfully against the schema.
Test suite updated: 268 tests passing (added 4 book validation tests).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 18:42:20 -05:00
kennethreitz 8a03d22b9a Add JSON schema validation with Pydantic
- Add Pydantic models for all 6 main data files:
  - bible_metadata.json
  - word_studies.json
  - study_guides.json
  - verse_commentary.json
  - featured_verses.json
  - resource_slugs.json

- Add BookIntroduction schema for book JSON files

- Create scripts/validate_data.py:
  - Validates JSON data using Pydantic models
  - Can generate JSON schemas from Pydantic models
  - CLI with --verbose and --generate-schemas flags

- Add test suite (tests/test_data_validation.py):
  - 12 tests validating data file structure
  - Parametrized tests for all data files
  - Integrated into existing test suite

All validation tests pass. JSON schemas auto-generated from Pydantic models.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 18:34:44 -05:00