A single static file, no build step, no server — proof that ganjoor-data on its own (fetched
live from jsDelivr) is enough to run a small reading app for classical Persian poetry.
- Loads
manifest.jsonand shows every poet. - Click a poet → their bio (
poet.json) + their root category's contents (_cat.json). - Click a category → its children, recursively, until you reach a poem.
- Click a poem → renders it as traditional right/left hemistich pairs (مصرع اول/دوم), with metre and rhyme shown when present.
- A "jump to poem by numeric id" box, demonstrating the bucketed id index
(
index/poems-by-id/{id / 2000}.json) resolving a bare id to a path. - Routing is hash-based (
#/hafez/ghazal/sh1) — works on GitHub Pages with zero server configuration, since there's no server-side route to configure in the first place.
Everything is fetched live, in the browser, straight from
https://cdn.jsdelivr.net/gh/ganjoor/ganjoor-data@main/ — there is no backend anywhere in this
app. That URL is the only "API base" set at the top of the <script> block in index.html.
- Create a new, empty GitHub repo (or use an existing one).
- Copy
index.htmlinto the root of that repo. That's the entire app — one file. - Push it.
- Repo → Settings → Pages → Source: Deploy from a branch → pick
main/(root)→ Save. - GitHub gives you a URL like
https://<username>.github.io/<repo>/within a minute or two.
No build step, no npm install, no config beyond that. Any static host works the same way
(Netlify, Cloudflare Pages, a plain python -m http.server locally to preview first) — GitHub
Pages is just the one named in the ask.
cd mini-ganjoor
python3 -m http.server 8000
then open http://localhost:8000. (A plain file:// open also mostly works, but some browsers
restrict fetch() from file:// origins — a local server sidesteps that.)
- No search —
ganjoor-datadoesn't have a search index yet (documented in its ownAPI.md). - Poems with unusual structures (free verse, unusual band forms) fall back to one line per verse rather than fully reproducing every classical form's exact traditional layout.
- No caching/offline support, no pagination for very large categories — it's a proof of concept, not a production reading app.