Add a diagnostic page for testing logos (#2890)

It can be helpful to have some diagnostic pages for development and quality control. I added one here for the logos, which renders all the named logos in ?style=flat and ?style=social.
This commit is contained in:
Paul Melnikow
2019-02-08 00:08:45 -05:00
committed by GitHub
parent c46d2f9dae
commit ae37e9b723
5 changed files with 97 additions and 13 deletions

View File

@@ -1,12 +1,17 @@
'use strict'
const path = require('path')
const glob = require('glob')
const logos = require('../lib/load-logos')()
const simpleIcons = require('../lib/load-simple-icons')()
const shieldsLogos = Object.keys(logos)
const simpleIconSet = new Set(Object.keys(simpleIcons))
shieldsLogos.forEach(logo => simpleIconSet.delete(logo))
const simpleIconNames = Array.from(simpleIconSet)
const supportedFeatures = {
logos: glob
.sync(`${__dirname}/../logo/*.svg`)
.map(filename => path.basename(filename, '.svg')),
shieldsLogos,
simpleIcons: simpleIconNames,
advertisedStyles: [
'plastic',
'flat',