lib/make/config.js
/**
 * Get user matadata
 *
 * User metadata must be set in a YAML file at the root of the source folder.
 * Only the following keys are allowed: title, description, authors, date, lang
 *
 * @return {object}
 */
Get user matadata
User metadata must be set in a YAML file at the root of the source folder.
Only the following keys are allowed: title, description, authors, date, lang

@return {object}
Get user matadata User metadata must be set in a YAML file at the root of the source folder . Only the following keys are allowed : title description authors date lang @return { object }
async function metadata () {
  const files = (await getYamlFiles(process.env.STUFF_FOLDER_SRC))
    .map(readTextFile)
  const data = combine({}, ...(await Promise.all(files))
    .map(txt => YAML.parse(txt, YAML_PARSE_CONFIG)))
  return [
    `title`,
    `description`,
    `authors`,
    `date`,
    `lang`
  ].reduce((safe, key) => {
    if (key in data) {
      safe[key] = data[key]
    }
    return safe
  }, {})
}
async function metadata ( ) { const files = ( await getYamlFiles ( process . env . STUFF_FOLDER_SRC ) ) . map ( readTextFile ) const data = combine ( { } , ... ( await Promise . all ( files ) ) . map ( txt => YAML . parse ( txt , YAML_PARSE_CONFIG ) ) ) return [ ` ` , ` ` , ` ` , ` ` , ` ` ] . reduce ( ( safe , key ) => { if ( key in data ) { safe [ key ] = data [ key ] } return safe } , { } ) }
Get user matadata
 User metadata must be set in a YAML file at the root of the source folder.
Get user matadata User metadata must be set in a YAML file at the root of the source folder .
// We allowed the following keys only as valide user metadata