Skip to content

Commit 89130b5

Browse files
committed
Add correct handling of CC0 icon and license url
Signed-off-by: Olga Bulat <obulat@gmail.com>
1 parent 1760bfb commit 89130b5

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 24 additions & 0 deletions
Loading

src/utils/license-utilities.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ const LicenseUtilities = {
2020
}
2121
Vue.prototype.$licenseUrl = function(shortLicenseName) {
2222
// Returns url to license
23+
if (shortLicenseName.includes('CC0')) {
24+
return 'https://creativecommons.org/publicdomain/zero/1.0/?ref=ccchooser'
25+
}
2326
const short = shortLicenseName.toLowerCase().slice(3, shortLicenseName.length - 4)
2427
return 'https://creativecommons.org/licenses/' + short + '/4.0/?ref=ccchooser'
2528
}
@@ -31,6 +34,9 @@ const LicenseUtilities = {
3134
.slice(0, shortLicenseName.length - 4)
3235
}
3336
Vue.prototype.$licenseIconsArr = function(shortLicenseName) {
37+
if (shortLicenseName.includes('CC0')) {
38+
return ['zero']
39+
}
3440
return shortLicenseName
3541
.toLowerCase()
3642
.slice(3, shortLicenseName.length - 4)

0 commit comments

Comments
 (0)