mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-17 16:34:48 -05:00
[PR #1944] feat(tinytorch): make the website an installable PWA #36554
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1944
Author: @farhan523
Created: 7/7/2026
Status: 🔄 Open
Base:
dev← Head:feat/tinytorch-pwa📝 Commits (1)
be03057feat(tinytorch): make the website an installable PWA📊 Changes
9 files changed (+235 additions, -1 deletions)
View changed files
📝
tinytorch/quarto/_quarto.yml(+14 -1)➕
tinytorch/quarto/assets/images/icons/apple-touch-icon.png(+0 -0)➕
tinytorch/quarto/assets/images/icons/icon-192.png(+0 -0)➕
tinytorch/quarto/assets/images/icons/icon-512.png(+0 -0)➕
tinytorch/quarto/assets/images/icons/icon-maskable-192.png(+0 -0)➕
tinytorch/quarto/assets/images/icons/icon-maskable-512.png(+0 -0)➕
tinytorch/quarto/assets/scripts/pwa.html(+28 -0)➕
tinytorch/quarto/manifest.webmanifest(+38 -0)➕
tinytorch/quarto/sw.js(+155 -0)📄 Description
Summary
Makes the TinyTorch site (mlsysbook.ai/tinytorch/) an installable Progressive Web App with offline reading support.
manifest.webmanifest— installability metadata with relativestart_url/scopeso it resolves correctly both under/tinytorch/in production and in local previews served at the root. Includesany+maskableicons (192/512) generated from the flame mark inlogo-tinytorch-simple.png, themed with the existing#D4740Cbrand color.sw.js(service worker) — conservative caching tuned for a frequently-deployed docs site:release-manifest.json,search.json, and any fetch/XHR always hit the network, so the release pill and search never go stale.assets/scripts/pwa.html— registers the worker at the site base path, derived at runtime because pages render at several directory depths and the site root differs between production (/tinytorch/) and previews (/). Registration is skipped silently on insecure contexts.<link>and icon use leading-/project-relative hrefs, which Quarto relativizes per page depth.No changes to page content or build tooling;
quarto renderoutput just gains the manifest, worker, and icons via the existingresources:mechanism, so the publish workflow deploys them as-is.Testing
quarto renderpasses; verified the manifest link and icon hrefs relativize correctly at all page depths (index.html,modules/,tito/)._buildlocally: all PWA URLs return 200, manifest parses,node --check sw.jspasses.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.