Skip to content

Custom badges #55

Closed
Closed

Description

Would be nice to be able to add custom badges like:

badges: 
  custom:
    analytics:
      text: 'Analytics'
      image: 'https://ga-beacon.appspot.com/some-ga-code/some-repo/readme'
      url: 'https://github.com/some-org-auth/some-repo'
      tooltip: 'hello'

something like the following code put into misc badges to parse these custom badges

custom = (opts) ->
  if opts == null
    opts = {}
  if !opts.badges.custom or !opts.name
    return ''
  else
    results = ''
    for key of opts.badges.custom
      customInfo = opts.badges.custom[key]
      tooltipFmtd = if customInfo.tooltip then ' "' + customInfo.tooltip + '"' else ''
      results += '[![' + customInfo.text + '](' + customInfo.image + ')](' + customInfo.url + tooltipFmtd + ')'

  results

I'll be happy to pull on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement or suggestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions