🚀 API Docs

Sphido.getPage(file, [...extenders])

Returns a page object generated from file.

Sphido.getPages(files, [...extenders])

Returns array of page objects from list of files.

Sphido.template.addFilter(name, func, [async])

Allow addFilter to nunjucks template engine.

Sphido.template.render(name, [context], [callback])

Renders the template named name with the context hash. If callback is provided, it will be called when done with any possible error as the first argument and the result as the second. Otherwise, the result is returned from render and errors are thrown. See nunjucks docs

Sphido.template.renderString(str, context, [callback])

Same as render, but renders a raw string instead of loading a template.

Sphido.template.toFile(file, template, vars)

Async function renders file from using a template.

Sphido.template.pagination(total, perpage)

Generate array of pages from pagination e.g. [1, 2, 3, 4, 5]


Array of default Sphido extenders.



Sphido dependencies