|
1 | | -# zilkworm-docs |
2 | | -Public documentation site for zilkworm |
| 1 | +# Zilkworm Docusaurus Site |
| 2 | + |
| 3 | +Source for **https://zilkworm.erigon.tech** — the public documentation for Zilkworm, built with [Docusaurus 3](https://docusaurus.io/). |
| 4 | + |
| 5 | +This repo is the entire site: configuration, theme overrides, the React landing page, and the markdown content under `docs/`. The Docusaurus build emits a static site that is published via GitHub Pages. |
| 6 | + |
| 7 | +## How it works |
| 8 | + |
| 9 | +- **Pages**: every `.md` file under [`docs/`](docs/) becomes a page. The sidebar is autogenerated from the directory tree; ordering comes from `sidebar_position` frontmatter and `_category_.json` in each subfolder. |
| 10 | +- **Landing page**: [`src/pages/index.tsx`](src/pages/index.tsx) is a custom React page served at `/` (hero, mission pillars, capability cards, CTAs). It bypasses the markdown pipeline. |
| 11 | +- **Navbar / footer**: configured in [`docusaurus.config.ts`](docusaurus.config.ts) and the swizzled [`src/theme/Footer/index.tsx`](src/theme/Footer/index.tsx). The footer cross-links sibling sites (Cocoon, Erigon docs) per the shared design spec. |
| 12 | +- **Theme tokens**: brand colors (Erigon orange `#EF7716`), Quantify / Montserrat / Nunito Sans fonts, light + dark surfaces, navbar buttons — all in [`src/css/custom.css`](src/css/custom.css). Fonts are self-hosted under [`static/fonts/`](static/fonts/). |
| 13 | +- **Diagrams**: Mermaid is enabled (`@docusaurus/theme-mermaid`); fenced ` ```mermaid ` blocks render inline. |
| 14 | +- **Search**: client-side via `@easyops-cn/docusaurus-search-local`, indexed at build time. |
| 15 | +- **Analytics**: Plausible script is injected via `headTags` in the config. |
| 16 | +- **Custom domain**: [`static/CNAME`](static/CNAME) pins the site to `zilkworm.erigon.tech` when published from GitHub Pages. |
| 17 | +- **SEO**: Each page has `title` + `description` frontmatter that becomes `<meta name="description">` and `og:description`. Global `og:image`, Twitter card, and site metadata are set in `docusaurus.config.ts`. `sitemap.xml` is generated at build time by `@docusaurus/preset-classic`; `static/robots.txt` references it. |
| 18 | +- **LLM-friendly**: [`scripts/generate-llms.py`](scripts/generate-llms.py) walks `docs/` and writes `static/llms.txt` (page index with descriptions) and `static/llms-full.txt` (full corpus). Regenerate after any docs change: |
| 19 | + ```bash |
| 20 | + python3 scripts/generate-llms.py |
| 21 | + ``` |
| 22 | + |
| 23 | +## Render it locally |
| 24 | + |
| 25 | +Requirements: **Node ≥ 20** (Docusaurus 3 requirement). |
| 26 | + |
| 27 | +```bash |
| 28 | +npm install # one-time |
| 29 | +npm run start # dev server with hot reload on http://localhost:3000 |
| 30 | +``` |
| 31 | + |
| 32 | +Other useful scripts (all defined in [`package.json`](package.json)): |
| 33 | + |
| 34 | +```bash |
| 35 | +npm run build # production build into ./build (static HTML/CSS/JS) |
| 36 | +npm run serve # serve the production build locally |
| 37 | +npm run typecheck # tsc — verifies docusaurus.config.ts, sidebars.ts, components |
| 38 | +npm run clear # clear the .docusaurus cache |
| 39 | +``` |
| 40 | + |
| 41 | +## Authoring content |
| 42 | + |
| 43 | +Add a new doc: |
| 44 | + |
| 45 | +1. Create `docs/<section>/<page>.md` (or a new section with its own `_category_.json`). |
| 46 | +2. Add Docusaurus frontmatter: |
| 47 | + |
| 48 | + ```yaml |
| 49 | + --- |
| 50 | + title: Page Title |
| 51 | + description: One-line meta description used for SEO + cards. |
| 52 | + sidebar_position: 3 |
| 53 | + --- |
| 54 | + ``` |
| 55 | + |
| 56 | +3. Save — the dev server hot-reloads. |
| 57 | + |
| 58 | +Notes: |
| 59 | + |
| 60 | +- If the title contains a colon, **quote it** (`title: "Foo: Bar"`) — otherwise YAML parsing fails. |
| 61 | +- MDX rejects raw `<` outside code fences. Use `<` or rephrase. Email/URL autolinks (`<a@b.com>`, `<https://…>`) need to be markdown links. |
| 62 | +- Inline JSX is allowed in `.md` files (Docusaurus treats them as MDX). The Welcome page (`docs/index.md`) imports the [`HomeCards`](src/components/HomeCards.tsx) component this way. |
| 63 | + |
| 64 | +## Layout |
| 65 | + |
| 66 | +``` |
| 67 | +zilkworm-docs/ |
| 68 | +├── docs/ # markdown content (sidebar autogenerated) |
| 69 | +│ ├── index.md # Welcome — served at /documentation |
| 70 | +│ ├── basics/ # _category_.json sets label + sidebar position |
| 71 | +│ ├── use-cases/ |
| 72 | +│ └── testing/ |
| 73 | +├── src/ |
| 74 | +│ ├── pages/ |
| 75 | +│ │ ├── index.tsx # custom landing at / |
| 76 | +│ │ └── index.module.css |
| 77 | +│ ├── components/ |
| 78 | +│ │ ├── HomeCards.tsx # 3-card grid used on the Welcome page |
| 79 | +│ │ └── HomeCards.module.css |
| 80 | +│ ├── css/custom.css # all theme tokens (colors, fonts, buttons, etc.) |
| 81 | +│ └── theme/ |
| 82 | +│ ├── Footer/index.tsx # swizzled footer (matches sibling sites) |
| 83 | +│ └── NotFound/ # swizzled 404 |
| 84 | +├── static/ |
| 85 | +│ ├── CNAME # zilkworm.erigon.tech |
| 86 | +│ ├── fonts/ # self-hosted woff2 — Quantify/Montserrat/NunitoSans |
| 87 | +│ └── img/ # logos, favicon, OG image |
| 88 | +├── docusaurus.config.ts # site identity, plugins, navbar, themeConfig |
| 89 | +├── sidebars.ts # autogenerated sidebar from `docs/` |
| 90 | +└── package.json |
| 91 | +``` |
| 92 | + |
| 93 | +## Design spec |
| 94 | + |
| 95 | +This site has two source-of-truth specs in `erigontech/erigon-documents`: |
| 96 | + |
| 97 | +- **[public-docs/docusaurus-design-spec.md](https://github.com/erigontech/erigon-documents/blob/master/public-docs/docusaurus-design-spec.md)** — Shared design across all Erigon docs sites (theme, fonts, footer pattern, NotFound shape, broken-link policy, gotchas). Read this first. |
| 98 | +- **[public-docs/zilkworm-docs-spec.md](https://github.com/erigontech/erigon-documents/blob/master/public-docs/zilkworm-docs-spec.md)** — Zilkworm-specific deltas: site identity, the custom React landing, MDX-conversion map from the GitBook migration, page content goals, tradenames, open questions. |
| 99 | + |
| 100 | +When something visual feels ambiguous or you need to add a new chrome element (navbar button, footer column, color token), check the design spec first — it's the source of truth across all sibling sites. Anything Zilkworm-specific (content structure, page intent, the landing page, the llms generator) belongs in `zilkworm-docs-spec.md`. |
0 commit comments