From 778b2093f8c3ebff5ae2951a7280de9a9ddeb5d7 Mon Sep 17 00:00:00 2001 From: Hananoshika Yomaru Date: Tue, 19 May 2026 03:55:50 -0700 Subject: [PATCH] Refactor mathematics curriculum structure: update math-related templates to use new curriculum JSON, enhance navigation links, and remove outdated references. Adjust chapter descriptions and improve catalog redirection for a streamlined user experience. --- content/math/_index.md | 6 +-- content/math/quadratic-equations/_index.md | 2 +- ...e-curriculum.json => math-curriculum.json} | 6 +-- spec.md | 2 +- static/_redirects | 2 + themes/openfreebooks/templates/catalog.html | 6 +-- themes/openfreebooks/templates/index.html | 14 ++--- .../templates/math-redirect.html | 27 ++++++++++ themes/openfreebooks/templates/math/book.html | 51 ------------------- .../openfreebooks/templates/math/chapter.html | 8 +-- .../math/quadratic-equations-content.html | 2 +- .../math/quadratic-equations-dse-callout.html | 9 ---- 12 files changed, 52 insertions(+), 83 deletions(-) rename data/{math-dse-curriculum.json => math-curriculum.json} (90%) create mode 100644 static/_redirects create mode 100644 themes/openfreebooks/templates/math-redirect.html delete mode 100644 themes/openfreebooks/templates/math/book.html delete mode 100644 themes/openfreebooks/templates/partials/math/quadratic-equations-dse-callout.html diff --git a/content/math/_index.md b/content/math/_index.md index 18b5712..b51abb5 100644 --- a/content/math/_index.md +++ b/content/math/_index.md @@ -1,6 +1,6 @@ +++ -title = "Hong Kong Mathematics" -description = "DSE Compulsory Part mathematics — Number & Algebra, Measures Shape & Space, and Data Handling." -template = "math/book.html" +title = "Mathematics" +description = "Browse mathematics chapters in the curriculum catalog." +template = "math-redirect.html" sort_by = "weight" +++ diff --git a/content/math/quadratic-equations/_index.md b/content/math/quadratic-equations/_index.md index b8b4d20..cd595e0 100644 --- a/content/math/quadratic-equations/_index.md +++ b/content/math/quadratic-equations/_index.md @@ -1,6 +1,6 @@ +++ title = "Quadratic equations" -description = "The discriminant, nature of roots, and the graph of y = ax² + bx + c — DSE Compulsory Part." +description = "The discriminant, nature of roots, and the graph of y = ax² + bx + c." template = "math/chapter.html" weight = 1 [extra] diff --git a/data/math-dse-curriculum.json b/data/math-curriculum.json similarity index 90% rename from data/math-dse-curriculum.json rename to data/math-curriculum.json index 13eb276..23e089c 100644 --- a/data/math-dse-curriculum.json +++ b/data/math-curriculum.json @@ -1,7 +1,7 @@ { - "title": "Hong Kong Mathematics", - "subtitle": "DSE Compulsory Part (S4–S6)", - "intro": "Structured around the three core strands of the Hong Kong mathematics curriculum. Chapters marked as available can be read now; others are on the roadmap.", + "title": "Mathematics", + "subtitle": "Secondary level (S4–S6)", + "intro": "Structured around three core strands. Chapters marked as available can be read now; others are on the roadmap.", "strands": [ { "id": "number-algebra", diff --git a/spec.md b/spec.md index cea5fb9..8b13e74 100644 --- a/spec.md +++ b/spec.md @@ -12,4 +12,4 @@ we don't i18n. i18n will be solved in future by big companies. search is supported by pagefind. -we have a catalog of subjects. Each subject will have chapters. Each chapters can be labelled (multiple) cirriculum. E.g. DSE, IB, A level. so that user knows if a chapter is needed in a cirriculum. Each subject should show all chapters by default (all cirriculum). chapters should be sequential in a tree structure. users can filter by themselves. \ No newline at end of file +we have a catalog of subjects. Each subject will have chapters. Each chapters can be labelled (multiple) cirriculum. E.g. DSE, IB, A level. so that user knows if a chapter is needed in a cirriculum. Each subject should show all chapters by default (all cirriculum). chapters should be sequential in a tree structure. users can filter by themselves. in the chapter we don't specify or mention the cirriculum anymore. \ No newline at end of file diff --git a/static/_redirects b/static/_redirects new file mode 100644 index 0000000..66d1e0f --- /dev/null +++ b/static/_redirects @@ -0,0 +1,2 @@ +/math/ /catalog/?subject=math 301 +/math /catalog/?subject=math 301 diff --git a/themes/openfreebooks/templates/catalog.html b/themes/openfreebooks/templates/catalog.html index 4dbe88a..0cdca4d 100644 --- a/themes/openfreebooks/templates/catalog.html +++ b/themes/openfreebooks/templates/catalog.html @@ -7,7 +7,7 @@ {% block content %} {% set catalog = load_data(path="data/catalog.json", format="json") %} -{% set math = load_data(path="data/math-dse-curriculum.json", format="json") %} +{% set math_catalog = load_data(path="data/math-curriculum.json", format="json") %}