From a60627c93af35a2f87bc2f7ed44ce702871a6f7d Mon Sep 17 00:00:00 2001 From: Ankit Tiwari Date: Thu, 3 Oct 2019 17:12:54 +0530 Subject: [PATCH] :sparkles: Display license badge even when there is no license url (#139) --- templates/default-no-html.md | 7 ++----- templates/default.md | 11 +++-------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/templates/default-no-html.md b/templates/default-no-html.md index 308089c..aff2056 100644 --- a/templates/default-no-html.md +++ b/templates/default-no-html.md @@ -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 %>) diff --git a/templates/default.md b/templates/default.md index 0cfb8b0..d25085e 100644 --- a/templates/default.md +++ b/templates/default.md @@ -23,14 +23,9 @@ Maintenance <% } -%> -<% if (isGithubRepos && licenseName && licenseUrl) { -%> - - License: <%= licenseName %> - -<% } -%> -<% if (!isGithubRepos && licenseName && licenseUrl) { -%> - - License: <%= licenseName %> +<% if (licenseName) { -%> + + License: <%= licenseName %> <% } -%> <% if (authorTwitterUsername) { -%>