static site generator

It’s just two functions.

getPages() reads your content tree, allPages() walks it. Everything else is plain JavaScript you already know. Rocket fast, lightweight, no framework.

Get started
8 packages 0 deps in core Node ≥22, pure ESM
index.js — the whole build
import {getPages, allPages, readFile, writeFile} from '@sphido/core';
import {marked} from 'marked';

const pages = await getPages({path: 'content'}, (page) => {
	page.slug = `${page.name}.html`;
});

for (const page of allPages(pages)) {
	await writeFile(`public/${page.slug}`, marked(await readFile(page.path)));
}
λ

Pure functions, no framework

Two functions and a few helpers. No config files, no plugin registry, no magic folders — your build is a script you can read in one sitting.

0

Zero-dependency core

@sphido/core ships with no runtime dependencies. Everything else — markdown renderer included — is your choice, not ours.

TS

Typed pages

Extenders export the types they contribute. Compose Page & WithFrontmatter & WithHashtags and your templates stop guessing.

Dev server included

@sphido/dev wraps your build with a watcher, a static server and live reload — zero dependencies, one function call.

Pick what you need

A tiny core and small, single-purpose packages around it. Versions are live from the npm registry.

create-sphido v1.1.0

Scaffold a working blog with one command — content, layout, sitemap and dev server included.

create-sphido docs
@sphido/core v3.1.0

getPages() and allPages() — the whole generator, with zero runtime dependencies.

Sphido core docs
@sphido/frontmatter v3.1.0

Reads YAML front matter into page.title, page.date, page.tags and friends.

Frontmatter docs
@sphido/hashtags v3.1.0

Turns #hashtags in content into links and collects them in page.tags.

Hashtags docs
@sphido/sitemap v4.0.0

Pure functions that render a protocol-correct sitemap.xml from your pages tree.

sitemap.xml docs
@sphido/feed v3.1.0

Valid RSS 2.0 with RFC 822 dates and atom self-link, rendered from plain objects.

RSS feed docs
@sphido/collections v1.0.0

Sorting, pagination, tag pages and prev/next navigation for blogs.

Collections docs
@sphido/dev v1.0.0

Watch mode, static server and browser live reload around your build function.

Dev server docs

Start a blog before your coffee cools down

The scaffolder sets up content, layout, hashtags, sitemap and a live-reload dev server. One command, no questions asked.

…or follow the cookbook for pagination, tags and RSS recipes.