pagez

pagez

pagez — Markdown, as pages.

A folder holds pages written in Markz, each .md at its folder's path, and what they use: a style.css, a frame.html, images and fonts. Pagez compiles each page, writes its head from its frontmatter, checks that every file and page it links is there, and Vite bundles them with hashed names. One page is the smallest site.

site/
├── index.md      the page at /
├── about.md      the page at about/
├── style.css     their design, in place of Pagez's theme
├── frame.html    the document around them, optional
├── img/
└── fonts/

A folder below uses the nearest style.css and frame.html above it, or its own.

pagez build site     # writes site/dist/
pagez dev site       # serves it while it's written
pagez preview site   # serves what was built
pagez preview site --port 4173   # on that port, or fails if it's taken
pagez check site     # lists what to fix in every page, and writes nothing
pagez rules folder-page   # prints a rule, an error or a warning

A folder with its own Vite config adds the plugin instead:

import pagez from "@amitkaps/pagez/vite";

export default { plugins: [pagez()] };

Usage says how to build with it, and pages has the rules a page and a site follow. 0.1 builds one page without elements or ${…}. Elements, ${…} and many pages are built since, and what's left comes next, in the plan.

Install

pnpm add -D @amitkaps/pagez vite-plus

It needs Node 26 or newer, the Node it's built and tested on.

Read the docs for its design, plan and lessons. It follows craftz's rules for how it builds, checks and releases.

Folders

  • docs/

    The writing that spans the code, in reading order.

  • src/

    Pagez's code, with index.ts as the library's entry, vite.ts as the Vite plugin, and cli.ts as the command. elements/ reads and renders the elements a page uses, and theme.css is the theme a page with no CSS gets.

  • tests/

    Pagez's tests, apart from its sources.

Docs

Code

  • .gitattributes

    The pages and sites the tests build are wrong on purpose, some of them, and the snapshots are what the tests write. So prose doesn't check them (usage).

  • .gitignore

    What git leaves out. That is installed packages, what a build writes, the OS's own files and secrets, which never belong in the repository.

  • cloudflare.config.ts

    The site is static files on a Cloudflare Worker, with no code. prose build writes the pages into .prose, and the Worker's deploy command, pnpm run ship, uploads them with craftz deploy. This file names the domain, so a deploy can't drop it.

  • pnpm-workspace.yaml

    pnpm 12 reads project settings from here, not from .npmrc or package.json. It's a settings file, not a workspace. craftz writes it, the same in every repository, so a change here is a change to the rules.

  • vite.config.ts

    One Vite+ config packs the package and checks it. vp pack writes ESM with its types, and runs publint, which fails the build on a package npm would serve badly.

No prose yet

.github/ · .vscode/

Other files

LICENSE · package.json · pnpm-lock.yaml · tsconfig.json