Skip to content

Commit

Permalink
✨ Display license badge even when there is no license url (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
anku255 authored and kefranabg committed Oct 3, 2019
1 parent d67b012 commit a60627c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
7 changes: 2 additions & 5 deletions templates/default-no-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
<% if (isGithubRepos) { -%>
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](<%= repositoryUrl %>/graphs/commit-activity)
<% } -%>
<% if (isGithubRepos && licenseName && licenseUrl) { -%>
[![License: <%= licenseName %>](https://img.shields.io/github/license/<%= authorGithubUsername %>/<%= projectName %>)](<%= licenseUrl %>)
<% } -%>
<% if (!isGithubRepos && licenseName && licenseUrl) { -%>
[![License: <%= licenseName %>](https://img.shields.io/badge/License-<%= licenseName %>-yellow.svg)](<%= licenseUrl %>)
<% if (licenseName) { -%>
[![License: <%= licenseName %>](https://img.shields.io/<%= isGithubRepos ? `github/license/${authorGithubUsername}/${projectName}` : `badge/License-${licenseName}-yellow.svg` %>)](<%= licenseUrl ? licenseUrl : '#' %>)
<% } -%>
<% if (authorTwitterUsername) { -%>
[![Twitter: <%= authorTwitterUsername %>](https://img.shields.io/twitter/follow/<%= authorTwitterUsername %>.svg?style=social)](https://twitter.com/<%= authorTwitterUsername %>)
Expand Down
11 changes: 3 additions & 8 deletions templates/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,9 @@
<img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" />
</a>
<% } -%>
<% if (isGithubRepos && licenseName && licenseUrl) { -%>
<a href="<%= licenseUrl %>" target="_blank">
<img alt="License: <%= licenseName %>" src="https://img.shields.io/github/license/<%= authorGithubUsername %>/<%= projectName %>" />
</a>
<% } -%>
<% if (!isGithubRepos && licenseName && licenseUrl) { -%>
<a href="<%= licenseUrl %>" target="_blank">
<img alt="License: <%= licenseName %>" src="https://img.shields.io/badge/License-<%= licenseName %>-yellow.svg" />
<% if (licenseName) { -%>
<a href="<%= licenseUrl ? licenseUrl : '#' %>" target="_blank">
<img alt="License: <%= licenseName %>" src="https://img.shields.io/<%= isGithubRepos ? `github/license/${authorGithubUsername}/${projectName}` : `badge/License-${licenseName}-yellow.svg` %>" />
</a>
<% } -%>
<% if (authorTwitterUsername) { -%>
Expand Down

0 comments on commit a60627c

Please sign in to comment.