index.js
function extractMetadata (content, callback) {
  var end;
  var result;
  var metadata = '';
  var body = content;

  // Metadata is defined by either starting and ending line,
  if (content.slice(0, 3) === '---') {
    result = content.match(/^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/);
    if (result && result.length === 3) {
      metadata = result[1];
      body = result[2];
    }
  }
  // or Markdown metadata section at beginning of file.
  else if (content.slice(0, 12) === '```metadata\n') {
    end = content.indexOf('\n```\n');
    if (end !== -1) {
      metadata = content.substring(12, end);
      body = content.substring(end + 5);
    }
  }

  parseMetadata(metadata, function (error, parsed) {
    if (error) return callback(error);
    callback(null, {
      metadata: parsed,
      body: body
    });
  });
}
function extractMetadata (content, callback) {
  var end;
  var result;
  var metadata = '';
  var body = content;

  // Metadata is defined by either starting and ending line,
  if (content.slice(0, 3) === '---') {
    result = content.match(/^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/);
    if (result && result.length === 3) {
      metadata = result[1];
      body = result[2];
    }
  }
  // or Markdown metadata section at beginning of file.
  else if (content.slice(0, 12) === '```metadata\n') {
    end = content.indexOf('\n```\n');
    if (end !== -1) {
      metadata = content.substring(12, end);
      body = content.substring(end + 5);
    }
  }

  parseMetadata(metadata, function (error, parsed) {
    if (error) return callback(error);
    callback(null, {
      metadata: parsed,
      body: body
    });
  });
}
function extractMetadata ( content , callback ) { var end ; var result ; var metadata = '' ; var body = content ; // Metadata is defined by either starting and ending line, if ( content . slice ( 0 , 3 ) === '---' ) { result = content . match ( / ^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$ / ) ; if ( result && result . length === 3 ) { metadata = result [ 1 ] ; body = result [ 2 ] ; } } // or Markdown metadata section at beginning of file. else if ( content . slice ( 0 , 12 ) === '```metadata\n' ) { end = content . indexOf ( '\n```\n' ) ; if ( end !== - 1 ) { metadata = content . substring ( 12 , end ) ; body = content . substring ( end + 5 ) ; } } parseMetadata ( metadata , function ( error , parsed ) { if ( error ) return callback ( error ) ; callback ( null , { metadata : parsed , body : body } ) ; } ) ; }
Also from the wintersmith markdown plugin.
Also from the wintersmith markdown plugin .