To generate stackbit.yaml
using content from files located in the current folder
> npm install @stackbit/cli -g
> stackbit generate \\
--pagesDir=./content \\
--dataDir=./data
Or using the npx
command
> npx @stackbit/cli generate
You can also use the generator in node:
npm install @stackbit/schema-utils
const path = require('path');
const { generator } require('@stackbit/schema-utils');
const stackbitYaml = await generator.generate({
dir: proccess.cwd()
pagesDir: path.join(proccess.cwd(), 'content'),
dataDir: path.join(proccess.cwd(), 'data')
});