static site generator
getPages() reads your content tree,
allPages() walks it. Everything else is
plain JavaScript you already know. Rocket fast, lightweight, no framework.
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)));
}
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.
@sphido/core ships with no runtime dependencies. Everything else — markdown renderer included — is your choice, not ours.
Extenders export the types they contribute. Compose Page & WithFrontmatter & WithHashtags and your templates stop guessing.
@sphido/dev wraps your build with a watcher, a static server and live reload — zero dependencies, one function call.
A tiny core and small, single-purpose packages around it. Versions are live from the npm registry.
Scaffold a working blog with one command — content, layout, sitemap and dev server included.
create-sphido docsgetPages() and allPages() — the whole generator, with zero runtime dependencies.
Sphido core docsReads YAML front matter into page.title, page.date, page.tags and friends.
Frontmatter docsTurns #hashtags in content into links and collects them in page.tags.
Hashtags docsPure functions that render a protocol-correct sitemap.xml from your pages tree.
sitemap.xml docsValid RSS 2.0 with RFC 822 dates and atom self-link, rendered from plain objects.
RSS feed docsSorting, pagination, tag pages and prev/next navigation for blogs.
Collections docsWatch mode, static server and browser live reload around your build function.
Dev server docsThe 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.