0.0.5 • Published 4 years ago

@ssgjs/source-yaml v0.0.5

Weekly downloads
21
License
MIT
Repository
github
Last release
4 years ago

@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
}
0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago