feat: extract CC

This commit is contained in:
gosangam
2026-04-14 16:45:55 +05:30
parent c5d4194d00
commit e2f8063d90
11358 changed files with 850485 additions and 23197 deletions
+27
View File
@@ -71,6 +71,33 @@ function loadBooks(): BookInfo[] {
});
}
// Śrī Caitanya-caritāmṛta
const ccIntroPath = path.join(booksDir, "cc", "intro.json");
if (fs.existsSync(ccIntroPath)) {
const cc = JSON.parse(fs.readFileSync(ccIntroPath, "utf-8"));
const totalChapters = cc.lilas.reduce(
(sum: number, l: { totalChapters: number }) => sum + l.totalChapters,
0,
);
const totalVerses = cc.lilas.reduce(
(sum: number, l: { chapters: { totalVerses: number }[] }) =>
sum +
l.chapters.reduce(
(s: number, ch: { totalVerses: number }) => s + ch.totalVerses,
0,
),
0,
);
books.push({
slug: "cc",
title: cc.title,
author: cc.author,
description: `${cc.totalLilas} līlās, ${totalChapters} chapters`,
totalVerses,
href: "/books/cc",
});
}
return books;
}