mirror of
https://github.com/HananoshikaYomaru/openfreebooks.git
synced 2026-11-13 13:05:51 +00:00
Enhance chapter content and metadata: Update SKILL.md to include requirements for chart axes in all widgets. Implement axis labels, arrowheads, and graduations in the simultaneous graph explorer widget. Update math curriculum JSON to reflect the status change of multiple chapters to live. Add last modified timestamps to chapter templates and generate corresponding metadata for improved site navigation and SEO.
This commit is contained in:
parent
353b129533
commit
eee5d109d5
31 changed files with 3093 additions and 17 deletions
|
|
@ -38,6 +38,29 @@ function mountFooterYear() {
|
|||
}
|
||||
}
|
||||
|
||||
function localizeChapterLastModified() {
|
||||
const times = document.querySelectorAll<HTMLTimeElement>("time[data-localize-lastmod]");
|
||||
if (times.length === 0) return;
|
||||
|
||||
const formatter = new Intl.DateTimeFormat(undefined, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
timeZoneName: "short",
|
||||
});
|
||||
|
||||
for (const timeEl of times) {
|
||||
const iso = timeEl.getAttribute("datetime");
|
||||
if (!iso) continue;
|
||||
|
||||
const date = new Date(iso);
|
||||
if (Number.isNaN(date.getTime())) continue;
|
||||
timeEl.textContent = formatter.format(date);
|
||||
}
|
||||
}
|
||||
|
||||
function scheduleBookMath() {
|
||||
void import("./lib/katex").then(({ renderBookMath }) => {
|
||||
requestAnimationFrame(() => renderBookMath());
|
||||
|
|
@ -150,6 +173,7 @@ function mountSubjectInit() {
|
|||
initBookMath();
|
||||
mountSubjectInit();
|
||||
mountChapterWidgets();
|
||||
localizeChapterLastModified();
|
||||
|
||||
const catalogRoot = document.getElementById("catalog-app");
|
||||
if (catalogRoot) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue