function generateTagPages(files, options) {
  gutil.log(' ', 'Generating tag pages for ' + options.section + '...');
  let allTags = {};
  files.forEach(function(file) {
    const tags = file.tags;
    tags.forEach(function(tag) {
      tag = tag.toLowerCase();
      if (!allTags[tag]) {
        allTags[tag] = {
          tag: tag,
          articles: [],
        };
      }
      allTags[tag].articles.push(file);
    });
  });
  let context = {
    title: options.title,
    tags: Object.keys(allTags).sort(),
    section: options.section,
  };
  let tmpl = path.join(global.WF.src.templates, 'tags', 'tag-index.md');
  let outputFile = path.join(options.outputPath, 'index.md');
  renderTemplate(tmpl, context, outputFile);
  tmpl = path.join(global.WF.src.templates, 'tags', 'tag_toc.yaml');
  outputFile = path.join(options.outputPath, '_toc.yaml');
  renderTemplate(tmpl, context, outputFile);
  Object.keys(allTags).forEach(function(key) {
    // eslint-disable-next-line max-len
    let name = options.section.replace(/(\w)(\w+[^s])(s|S)?\b/, (_, a, b) => a.toUpperCase() + b + 's');
    const opts = {
      title: 'All ' + name + ' tagged: ' + key + '',
      section: options.section,
      outputFile: path.join(options.outputPath, key + '.md'),
    };
    _generateListPage(allTags[key].articles, opts);
  });
}
Generate the tag pages

@param {Array} files List of files
@param {Object} options Options used to generate the widget