Sphido Logo

A rocket 🚀 fast, lightweight, static site generator

Installation

$ npm i @sphido/core @sphido/frontmatter @sphido/marked @sphido/meta @sphido/nunjucks # or
$ yarn add @sphido/core @sphido/frontmatter @sphido/marked @sphido/meta @sphido/nunjucks

Quick Start

const {getPages} = require('@sphido/core');
const {save} = require('@sphido/nunjucks');
const globby = require('globby');

(async () => {

    // 1. get list of pages
    const pages = await getPages(
        await globby('content/**/*.md'),
        ...[
            require('@sphido/frontmatter'),
            require('@sphido/marked'),
            require('@sphido/meta'),
            {save},
        ],
    );

    // 2. save them (with default template)
    for await (const page of pages) {
        await page.save(
            page.dir.replace('content', 'public')
        );
    }

})();

Need more examples or tutorials? View API docs or explore sphido.org source codes.

Github logo Source codes