Skip to content

Instantly share code, notes, and snippets.

@pankajpatel
Created January 16, 2018 09:07
Show Gist options
  • Save pankajpatel/eb259916da9ec2dbd00e75a7be6907c1 to your computer and use it in GitHub Desktop.
Save pankajpatel/eb259916da9ec2dbd00e75a7be6907c1 to your computer and use it in GitHub Desktop.
module.exports = (scope) => `<div class="tags">
${scope.tags.map(tag => `
${(() => {
tag.classes = (tag.classes || [])
.push(tag.name.matches('js') ? 'tag-blue' : '')
})()}
<a href="${tag.link}" class="${tag.classes.join(' ')}">${tag.name}</a>
`).join('')}
</div>`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment