Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src
test
.gitignore
package.json
readme.md

readme.md

@sphido/nunjucks

Install

yarn add @sphido/nunjucks

Usage

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

(async () => {

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

	// 2. save to html with default template
	for await (const page of posts) {
		page.save(
			page.dir.replace('content', 'public')
		);
	}
})();
You can’t perform that action at this time.