index.js
function parseFrontMatter( file, post, options ) {

	var _formatDate = options && typeof options.formatDate === 'function' ?
				options.formatDate : formatDate,
			content = frontMatter( file.contents.toString() ),
			prop = '';

	if ( content.attributes ) {

		post.category = content.attributes.category || '';
		post.created = content.attributes.created ? _formatDate( content.attributes.created ) : '';
		post.title = content.attributes.title || '';
		post.updated = content.attributes.updated ? _formatDate( content.attributes.updated ) : '';

		if ( content.attributes.excerpt ) {

			post.excerpt = markdown( content.attributes.excerpt );
		}

		post.content = content.body ? markdown( content.body ) : '';

		if ( post.content && highlightSyntax ) {

			highlightPostSyntax( post );
		}

		// Look for custom front-matter
		for ( prop in content.attributes ) {

			if ( content.attributes.hasOwnProperty( prop ) && isCustomFrontMatter( prop ) ) {

				post[ prop ] = content.attributes[ prop ];
			}
		}
	}
}
function parseFrontMatter( file, post, options ) {

	var _formatDate = options && typeof options.formatDate === 'function' ?
				options.formatDate : formatDate,
			content = frontMatter( file.contents.toString() ),
			prop = '';

	if ( content.attributes ) {

		post.category = content.attributes.category || '';
		post.created = content.attributes.created ? _formatDate( content.attributes.created ) : '';
		post.title = content.attributes.title || '';
		post.updated = content.attributes.updated ? _formatDate( content.attributes.updated ) : '';

		if ( content.attributes.excerpt ) {

			post.excerpt = markdown( content.attributes.excerpt );
		}

		post.content = content.body ? markdown( content.body ) : '';

		if ( post.content && highlightSyntax ) {

			highlightPostSyntax( post );
		}

		// Look for custom front-matter
		for ( prop in content.attributes ) {

			if ( content.attributes.hasOwnProperty( prop ) && isCustomFrontMatter( prop ) ) {

				post[ prop ] = content.attributes[ prop ];
			}
		}
	}
}
function parseFrontMatter ( file , post , options ) { var _formatDate = options && typeof options . formatDate === 'function' ? options . formatDate : formatDate , content = frontMatter ( file . contents . toString ( ) ) , prop = '' ; if ( content . attributes ) { post . category = content . attributes . category || '' ; post . created = content . attributes . created ? _formatDate ( content . attributes . created ) : '' ; post . title = content . attributes . title || '' ; post . updated = content . attributes . updated ? _formatDate ( content . attributes . updated ) : '' ; if ( content . attributes . excerpt ) { post . excerpt = markdown ( content . attributes . excerpt ) ; } post . content = content . body ? markdown ( content . body ) : '' ; if ( post . content && highlightSyntax ) { highlightPostSyntax ( post ) ; } // Look for custom front-matter for ( prop in content . attributes ) { if ( content . attributes . hasOwnProperty ( prop ) && isCustomFrontMatter ( prop ) ) { post [ prop ] = content . attributes [ prop ] ; } } } }
Parse YAML front matter from post

@param {Object} file The post file object
@param {Object} post The new post object we're working with
@param {Object} [options]
Parse YAML front matter from post