From One Dataset to 220 SEO-Ready Pages: An Engineering Practice for the I Ching

A practical (and slightly unconventional) idea: what if your content site's SEO foundation were compiled, just like code — "write once, generate everywhere"?

I maintain an open-source dataset of the I Ching's 64 hexagrams (64 hexagrams × 384 lines, organized as Python dictionaries). It started as a data repository, but I wanted it to become a readable website. Hand-writing 64 hexagram pages would mean repetitive content, error-prone meta tags, and painful maintenance.

So I made an engineering decision: write a static site generator that "compiles" the data into web pages. The result: 220 pages (bilingual, plus solar terms, personality tests, etc.), all with complete SEO tags.

Generator design

1. Data as configuration

Each hexagram is one data record with fixed fields (name, symbol, judgment, line texts, plain-language interpretation, application scenarios). The generator iterates over the data dict and produces one page per hexagram: gua-01.html ~ gua-64.html.

2. SEO tags, generated

Title / description / canonical / Open Graph / Twitter Card / JSON-LD are all auto-filled from data:

def page_seo(gua):
    return {
        "title": f"{gua['name']} Hexagram: {gua['full']} ({gua['sym']}) | I Ching 64 Hexagrams",
        "description": f"{gua['full']}: {gua['mean'][:50]}...",
        "canonical": f"https://claw-book.cn/gua-{gua['id']:02d}.html",
        "jsonld": article_jsonld(gua),
    }

The benefit: 64 pages get complete, non-duplicated meta without hand-writing a single tag.

3. Interlinked network

Each page auto-generates links to related hexagrams (previous / next / changing), forming a mesh structure that search engines love to crawl.

4. Bilingual rendering

The same data renders both Chinese and English pages (gua-01.html / gua-01.en.html) with mutual hreflang annotations. English pages serve overseas readers; Chinese pages serve the domestic audience.

SEO infrastructure after launch

Page generation was step one. After going live, I added:

Lessons learned

  1. SEO is a product feature, not a late patch: putting tag rules into the generator beats batch-editing afterward by an order of magnitude.
  2. The data model decides everything: with clean field design, pages, sitemap and JSON-LD are just projections of the data.
  3. Indexing takes patience: a low indexing rate in the first 1-2 weeks is normal for a new site. Do the foundation work, then let time accumulate.

The project is open source (MIT): github.com/ccbaby2813-boop/tianji-tuiyan · Live site: https://claw-book.cn · 64 Hexagrams guide: https://claw-book.cn/liu-shi-si-gua.html

If you're also building "data → website" pipelines, I'd love to discuss generator design trade-offs.

Try the Result: TianJi Insight

The 64-hexagram AI personality and matching app — built from the same structured data.

Download TianJi Insight App