Fix chapter file naming to use Chapter_XX.md format

This commit is contained in:
Ryderjj89
2025-09-13 15:44:56 -04:00
parent 1e819e33c7
commit a333415630

View File

@@ -22,11 +22,12 @@ const BibleReader: React.FC<BibleReaderProps> = ({ book, chapter, onBack }) => {
setLoading(true); setLoading(true);
console.log(`Loading chapter: ${book}/${chapter}`); console.log(`Loading chapter: ${book}/${chapter}`);
// Pad chapter number with leading zero if needed // Format chapter as "Chapter_XX" with leading zero
const paddedChapter = chapter.padStart(2, '0'); const paddedChapter = chapter.padStart(2, '0');
console.log(`Padded chapter: ${paddedChapter}`); const chapterFileName = `Chapter_${paddedChapter}`;
console.log(`Chapter file name: ${chapterFileName}`);
const chapterContent = await getChapter(book, paddedChapter); const chapterContent = await getChapter(book, chapterFileName);
setContent(chapterContent); setContent(chapterContent);
} catch (error) { } catch (error) {
console.error('Failed to load chapter:', error); console.error('Failed to load chapter:', error);