Sphido logo

@sphido/core

Core contains most important getPage() and getPages() functions.

Basic page object looks like bellow:

{
  "file":"path to the file",
  "dir": " directory to the file",
  "base" : "file basename without extension",
  "content": "content of file"
}

Pages are merged inside getPage() function together with extenders. Extender can be object or function.

Install

yarn add @sphido/core

Example

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

(async () => {

  const pages = await getPages(
    await globby('content/**/*.{md,html}')
  );
})();

Source codes

https://github.com/sphido/sphido/tree/master/packages/sphido-core