function readMetadataForFile(file) {
  const content = fs.readFileSync(file, 'utf8');
  if (testHelper.isInclude(file, content)) {
    return null;
  }
  let description = wfRegEx.getMatch(wfRegEx.RE_SNIPPET, content);
  if (!description) {
    description = wfRegEx.getMatch(wfRegEx.RE_DESCRIPTION, content);
  }
  let published = moment(wfRegEx.getMatch(wfRegEx.RE_PUBLISHED_ON, content));
  published = published.utcOffset(0, true);
  let updated = moment(wfRegEx.getMatch(wfRegEx.RE_UPDATED_ON, content));
  updated = updated.utcOffset(0, true);
  let featured = wfRegEx.getMatch(wfRegEx.RE_FEATURED_DATE, content, NO_DATE);
  featured = moment(featured).utcOffset(0, true);
  const url = file
    .replace('src/content/en/', '/web/')
    .replace('.md', '')
    .replace('.html', '')
    .replace(/\/index$/, '/');
  let result = {
    filePath: file,
    url: url,
    title: wfRegEx.getMatch(wfRegEx.RE_TITLE, content),
    description: description,

    image: wfRegEx.getMatch(wfRegEx.RE_IMAGE, content),
    imageSquare: wfRegEx.getMatch(wfRegEx.RE_IMAGE_SQUARE, content),

    datePublishedMoment: published,
    datePublishedMonth: published.format('MM'),
    datePublishedYear: published.format('YYYY'),

    dateUpdatedMoment: updated,
    dateUpdatedMonth: updated.format('MM'),
    dateUpdatedYear: updated.format('YYYY'),

    tags: [],
    vertical: wfRegEx.getMatch(wfRegEx.RE_VERTICAL, content),

    dateFeaturedMoment: featured,
    dateFeaturedMonth: featured.format('MM'),
    dateFeaturedYear: featured.format('YYYY'),
  };
  const authorList = content.match(wfRegEx.RE_AUTHOR_LIST);
  if (authorList) {
    result.authors = [];
    authorList.forEach(function(contributor) {
      const author = wfRegEx.getMatch(wfRegEx.RE_AUTHOR_KEY, contributor);
      result.authors.push(author.trim());
    });
  }
  const region = wfRegEx.getMatch(wfRegEx.RE_REGION, content);
  if (region) {
    result.region = region.trim();
  }
  const tags = wfRegEx.getMatch(wfRegEx.RE_TAGS, content);
  if (tags) {
    result.tags = [];
    tags.split(',').forEach(function(tag) {
      tag = tag.trim();
      if (tag.length > 0) {
        result.tags.push(tag);
      }
    });
  }
  const podcast = wfRegEx.getMatch(wfRegEx.RE_PODCAST, content);
  if (podcast) {
    result.podcast = {
      audioUrl: podcast,
      duration: wfRegEx.getMatch(wfRegEx.RE_PODCAST_DURATION, content),
      subtitle: wfRegEx.getMatch(wfRegEx.RE_PODCAST_SUBTITLE, content),
      fileSize: wfRegEx.getMatch(wfRegEx.RE_PODCAST_SIZE, content),
    };
  }
  return result;
}
Reads the metadata from a markdown file

@param {string} file The path to the file to read.
@return {Object} the meta data of the file.