New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes #134: Display license badge even when there is no license url #139
Conversation
Codecov Report
@@ Coverage Diff @@
## master #139 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 24 23 -1
Lines 197 196 -1
Branches 21 21
=====================================
- Hits 197 196 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some refacto could be done with the license badges. For example for the no-html template, we could have something like:
<% if (licenseName) { -%>
[![License: <%= licenseName %>](https://img.shields.io/<% if (isGithubRepos) { -%>
github/license/<%= authorGithubUsername %>/<%= projectName %><% } else { -%>
badge/License-<%= licenseName %>-yellow.svg
<% } -%>
)](<% if (licenseUrl) { -%>
<%= licenseUrl %><% } else { -%>
#<% } -%>
)
<% } -%>
Not that easy to understand but it remove duplicated code
Hi @kefranabg! Thanks for reviewing my code. I have used the ternary operator to remove the duplicated code. It looked more readable to me than using if statements. If you don't feel the same way then I will use if statements instead. |
@anku255 Way better you're right |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for you work!
@all-contributors please add anku255 for code |
I've put up a pull request to add @anku255! 🎉 |
When there is a license name but no license URL, we will show the license badge with
href=#
.Example Image:
I ran the tests and all tests are passing.
If it is not the desired fix, please let me know and I will update my PR accordingly.
Thank you.