function parseMetadata(lines) {
    var retVal = {};

    lines.each(function (line) {
        if (line.has(metadataMarker) && line.has('=')) {
            line = line.replace(metadataMarker, '');
            line = line.compact();
            var firstIndex = line.indexOf('=');
            retVal[line.first(firstIndex)] = line.from(firstIndex + 1);
        } else if (line.has(':')) {
            line = line.compact();
			var firstIndex = line.indexOf(':');
			retVal[line.first(firstIndex)] = line.from(firstIndex + 2);
		}
    });
	
	// Description could have a " in it that needs to be escaped.
	if (Object.has(retVal, "Description")) {
		retVal["Description"] = retVal["Description"].replace(/"/g, '&quot;')
	}

    // NOTE: Some metadata is added in generateHtmlAndMetadataForFile().

    // Merge with site default metadata
    Object.merge(retVal, siteMetadata, false, function (key, targetVal, sourceVal) {
        // Ensure that the file wins over the defaults.
        return targetVal;
    });

    return retVal;
}
// Parses the metadata in the file
Parses the metadata in the file
Parses the metadata in the file
function parseMetadata(lines) {
    var retVal = {};
    lines.each(function (line) {
        if (line.has(metadataMarker) && line.has('=')) {
            line = line.replace(metadataMarker, '');
            line = line.compact();
            var firstIndex = line.indexOf('=');
            retVal[line.first(firstIndex)] = line.from(firstIndex + 1);
        } else if (line.has(':')) {
            line = line.compact();
			var firstIndex = line.indexOf(':');
			retVal[line.first(firstIndex)] = line.from(firstIndex + 2);
		}
    });
	if (Object.has(retVal, "Description")) {
		retVal["Description"] = retVal["Description"].replace(/"/g, '&quot;')
	}
    Object.merge(retVal, siteMetadata, false, function (key, targetVal, sourceVal) {
        return targetVal;
    });
    return retVal;
}
function parseMetadata ( lines ) { var retVal = { } ; lines . each ( function ( line ) { if ( line . has ( metadataMarker ) && line . has ( '=' ) ) { line = line . replace ( metadataMarker , '' ) ; line = line . compact ( ) ; var firstIndex = line . indexOf ( '=' ) ; retVal [ line . first ( firstIndex ) ] = line . from ( firstIndex + 1 ) ; } else if ( line . has ( ':' ) ) { line = line . compact ( ) ; var firstIndex = line . indexOf ( ':' ) ; retVal [ line . first ( firstIndex ) ] = line . from ( firstIndex + 2 ) ; } } ) ; if ( Object . has ( retVal , "Description" ) ) { retVal [ "Description" ] = retVal [ "Description" ] . replace ( / " / g , '&quot;' ) } Object . merge ( retVal , siteMetadata , false , function ( key , targetVal , sourceVal ) { return targetVal ; } ) ; return retVal ; }
Parses the metadata in the file
Parses the metadata in the file
// Description could have a " in it that needs to be escaped. // NOTE: Some metadata is added in generateHtmlAndMetadataForFile(). // Merge with site default metadata // Ensure that the file wins over the defaults.