The SSG procedure to generate a book online with versioning https://openfreebooks.org
Find a file
2026-05-19 11:57:50 -07:00
.agents/skills Enhance contributing guidelines in CONTRIBUTING.md with a readable link, update curriculum JSON structure to include chapter tiers, and improve catalog chapter card display with tier badges. Update package.json for testing scripts and add contributing URL in zola.toml. Refactor frontend components and styles for better integration of new features. 2026-05-19 05:34:25 -07:00
content Enhance contributing guidelines in CONTRIBUTING.md with a readable link, update curriculum JSON structure to include chapter tiers, and improve catalog chapter card display with tier badges. Update package.json for testing scripts and add contributing URL in zola.toml. Refactor frontend components and styles for better integration of new features. 2026-05-19 05:34:25 -07:00
data Refactor CatalogApp to replace JSON canvas viewer with Mermaid for chapter map generation, update related components and styles for improved interactivity, and enhance contributing guidelines to reflect new features. Remove unused canvas-related code and dependencies to streamline the project. 2026-05-19 10:49:28 -07:00
frontend/src Update TypeScript configuration to exclude test files, enhance CatalogMermaidView component with improved SVG handling and zoom functionality, and modify catalog-to-mermaid logic to include rootNodeId in diagram output. Adjust styles for z-index in catalog components for better layering. 2026-05-19 11:57:50 -07:00
scripts Enhance package.json with a new script for scanning output size and update index.html to improve the hero section's heading with a new design and messaging. 2026-05-19 01:21:41 -07:00
static 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. 2026-05-19 03:55:50 -07:00
themes/openfreebooks Update TypeScript configuration to exclude test files, enhance CatalogMermaidView component with improved SVG handling and zoom functionality, and modify catalog-to-mermaid logic to include rootNodeId in diagram output. Adjust styles for z-index in catalog components for better layering. 2026-05-19 11:57:50 -07:00
.gitignore Update .gitignore to include all static assets from Vite build output, modify CONTRIBUTING.md to clarify commit guidelines regarding Vite output, and remove obsolete static assets and JavaScript files from the themes directory to streamline the project structure. 2026-05-19 10:52:57 -07:00
bun.lock Refactor CatalogApp to replace JSON canvas viewer with Mermaid for chapter map generation, update related components and styles for improved interactivity, and enhance contributing guidelines to reflect new features. Remove unused canvas-related code and dependencies to streamline the project. 2026-05-19 10:49:28 -07:00
CONTRIBUTING.md Update .gitignore to include all static assets from Vite build output, modify CONTRIBUTING.md to clarify commit guidelines regarding Vite output, and remove obsolete static assets and JavaScript files from the themes directory to streamline the project structure. 2026-05-19 10:52:57 -07:00
LICENSE Update project configuration and documentation: set version in package.json, enhance spec.md with canvas feature details, add credits URL in zola.toml, and improve footer layout in base.html. Remove unused static files including 404.html, index.html, main.css, robots.txt, site.webmanifest, and sitemap.xml. 2026-05-18 22:33:20 -07:00
package.json Refactor CatalogApp to replace JSON canvas viewer with Mermaid for chapter map generation, update related components and styles for improved interactivity, and enhance contributing guidelines to reflect new features. Remove unused canvas-related code and dependencies to streamline the project. 2026-05-19 10:49:28 -07:00
README.md Update dependencies in package.json and bun.lock, enhance README with curriculum contribution guidelines, and improve catalog structure with graph data for mathematics. Add new styles for chapter headers and catalog view toggles in SASS, and implement copy page button functionality in frontend components. 2026-05-19 05:06:17 -07:00
skills-lock.json Update .gitignore to include additional static assets for KaTeX, add KaTeX and Commander dependencies in package.json and bun.lock, enhance footer with an About link in base.html, and improve work card links in index.html. Update Vite configuration for asset handling and add new components in SASS files. 2026-05-18 23:35:42 -07:00
spec.md Refactor CatalogApp to replace JSON canvas viewer with Mermaid for chapter map generation, update related components and styles for improved interactivity, and enhance contributing guidelines to reflect new features. Remove unused canvas-related code and dependencies to streamline the project. 2026-05-19 10:49:28 -07:00
tsconfig.json Update TypeScript configuration to exclude test files, enhance CatalogMermaidView component with improved SVG handling and zoom functionality, and modify catalog-to-mermaid logic to include rootNodeId in diagram output. Adjust styles for z-index in catalog components for better layering. 2026-05-19 11:57:50 -07:00
vite.config.ts Update .gitignore to include additional static assets for KaTeX, add KaTeX and Commander dependencies in package.json and bun.lock, enhance footer with an About link in base.html, and improve work card links in index.html. Update Vite configuration for asset handling and add new components in SASS files. 2026-05-18 23:35:42 -07:00
wrangler.jsonc Update zola.toml to include site title, description, theme, and additional URLs for navigation 2026-05-18 21:06:12 -07:00
zola.toml Enhance contributing guidelines in CONTRIBUTING.md with a readable link, update curriculum JSON structure to include chapter tiers, and improve catalog chapter card display with tier badges. Update package.json for testing scripts and add contributing URL in zola.toml. Refactor frontend components and styles for better integration of new features. 2026-05-19 05:34:25 -07:00

Open Free Books

Free, open-source textbooks for every learner — from elementary school through university. The site is fully static, open on GitHub, and deployed to Cloudflare.

Live site: openfreebooks.org

Stack

Layer Tool
Site generator Zola
Theme Custom theme in themes/openfreebooks/
Interactivity Solid.js (header, marquee, scroll reveal, theme toggle)
JS build Bun + Vite
Hosting Cloudflare Workers (static assets via Wrangler)

Chapter content is HTML partials in the theme today (not Markdown). Canvas maps use the JSON Canvas standard (Obsidian-compatible) via json-canvas-viewer.

Contributing curriculum, subjects, or chapters? See CONTRIBUTING.md.

Prerequisites

Project layout

content/                 # Pages and sections (Markdown front matter)
data/                    # Catalog + per-subject curriculum JSON
static/                  # Site assets copied to public/ (favicons, _redirects)
themes/openfreebooks/    # Zola theme
  templates/             # HTML (Tera)
  sass/                  # Stylesheets (compiled to main.css)
  static/js/bundle.js    # Built Solid bundle (committed for simple deploys)
frontend/src/            # Solid.js source
public/                  # Zola build output (gitignored) — Wrangler deploy target
wrangler.jsonc           # Cloudflare Workers static assets config

Development

Install JS dependencies:

bun install

Build the Solid bundle and start Zola’s dev server:

bun run build:js
zola serve

Open http://127.0.0.1:1111. Re-run bun run build:js (or bun run dev:js in another terminal) when you change frontend/.

Production build

bun run build

This runs vite build (outputs to themes/openfreebooks/static/js/bundle.js) and then zola build (outputs to public/).

Deploy to Cloudflare

bun run build
wrangler deploy

The Worker name is openfreebooks (see wrangler.jsonc). Assets are served from public/ with no server-side logic.

Configuration

Site-wide settings live in zola.toml:

  • base_url — canonical URL for feeds and absolute links
  • [extra] — site_title, github_url, browse_url, about_url (used in templates and the Solid config block)

Theme notes

The visual design is inspired by manlung.work: paper background with grain, Instrument Serif headings, warm ochre accent (#9a6b2e), and light/dark mode (system preference plus a toggle).

Keep themes/openfreebooks/static/ clean. Only committed built assets belong there (currently js/bundle.js). Do not copy Zola’s public/ output into the theme static/ folder — that pollutes public/js/ on the next build.

Contributor experience — known friction (task list)

These issues make contributions harder than they should be. PRs that fix any item are welcome.

Catalog & data

  • Auto-wire subjects in catalog.html — stop hardcoding if subject.id == "math"; load data/{id}-curriculum.json by subject id convention.
  • Single source for subjects — merge catalog.json subject stubs and {subject}-curriculum.json or generate one from the other at build time.
  • scripts/validate-curriculum.ts — JSON schema check: slugs, curriculums ⊆ global list, live chapters have content/, graph.edges acyclic.
  • Document or script new curriculum labels — today requires catalog.json, Sass badge, and TS curriculumBadgeClass() mapping.

Chapters & content

  • Generic chapter template — drop per-chapter {% if chapter_id %} branches; load partials/{subject}/{slug}-content.html by convention.
  • Strand kicker from data — chapter header still hardcodes “Number & Algebra”; should come from strand in curriculum JSON.
  • Subject-agnostic chapter template — breadcrumb/catalog URL and load_data path should use section path, not math only.
  • Markdown chapters (optional) — README/spec disagree on format; if staying HTML, document clearly everywhere.
  • Defuddle “copy as Markdown” — spec calls for it on every page; not implemented.

Site & discoverability

  • Data-driven homepage cards — “Browse by subject” / featured blocks duplicate manual edits in index.html.
  • Pagefind search — spec mentions search; build_search_index = false and no index step in build.
  • CONTRIBUTING wizard or checklist in CI — fail PR if live chapter missing partial or catalog entry.

Build & repo hygiene

  • Prevent stale theme static/**/*.html — committed copies under themes/openfreebooks/static/ override Zola output (index, catalog, math); add CI check or pre-commit.
  • Clarify package manager — project uses Bun (bun run build); align docs/tooling if pnpm is preferred elsewhere.
  • dev one-liner — e.g. bun run dev running vite build --watch + zola serve together.

New subject onboarding

  • Subject scaffold command — e.g. bun run scaffold:subject science creating data/science-curriculum.json, content/science/_index.md, and catalog entry.
  • Redirect template generic — math-redirect.html → subject-redirect.html using ?subject= from section path.

Agent skills

Skill Path Use
OFB (this project) .agents/skills/ofb/SKILL.md Catalog, curriculum JSON, chapters, product rules
Zola + Solid .agents/skills/zola/SKILL.md Templates, Sass, bundle, zola serve

License

Open source — see the repository license file when added.