@ssgjs/source-yaml
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

@ssgjs/source-yaml

example usage

// ssg.config.js
const yaml = require('@ssgjs/source-yaml')
const events = yaml({ dirPath: 'content/events' })

exports.plugins = {
  events,
}

// not needed
exports.getDataSlice = async (key, uid) => {
  console.log('optional getDataSlice action')
  // etc
}

// mandatory. called once, should be cheap
exports.createIndex = async (mainIndex = {}) => {
  console.log('getting intial data')
  // can add more data to index here
  console.log('Number of Events:', Object.keys(mainIndex.events).length)
  return mainIndex
}

Readme

Keywords

Package Sidebar

Install

npm i @ssgjs/source-yaml

Weekly Downloads

2

Version

0.0.5

License

MIT

Unpacked Size

9.15 kB

Total Files

6

Last publish

Collaborators

  • sw-yx