examples/config.js
function posts (content, contentType) {
  let output = {}
  const allFiles = content.filter(each => each.dir.includes(`/${contentType}`))
  const index = allFiles.filter(each => each.base === 'index.md')[0]
  index.attr.forEach(each => {
    allFiles.forEach(file => {
      if (file.name === each) {
        output[each] = file
      }
    })
  })
  return output
}
function posts (content, contentType) {
  let output = {}
  const allFiles = content.filter(each => each.dir.includes(`/${contentType}`))
  const index = allFiles.filter(each => each.base === 'index.md')[0]
  index.attr.forEach(each => {
    allFiles.forEach(file => {
      if (file.name === each) {
        output[each] = file
      }
    })
  })
  return output
}
function posts ( content , contentType ) { let output = { } const allFiles = content . filter ( each => each . dir . includes ( ` ${ contentType } ` ) ) const index = allFiles . filter ( each => each . base === 'index.md' ) [ 0 ] index . attr . forEach ( each => { allFiles . forEach ( file => { if ( file . name === each ) { output [ each ] = file } } ) } ) return output }
Posts content type translation
@param  {Array} content      List of files
@param  {String} contentType Content type name
@return {Object}             The posts content type data object
Posts content type translation