diff --git a/swh/web/assets/config/webpack-plugins/generate-weblabels-webpack-plugin/index.js b/swh/web/assets/config/webpack-plugins/generate-weblabels-webpack-plugin/index.js --- a/swh/web/assets/config/webpack-plugins/generate-weblabels-webpack-plugin/index.js +++ b/swh/web/assets/config/webpack-plugins/generate-weblabels-webpack-plugin/index.js @@ -191,10 +191,16 @@ let parsedSpdxLicenses = this.parseSpdxLicenseExpression(scriptSrc['spdxLicenseExpression'], `file ${scriptSrc['path']}`); scriptSrcData['licenses'] = this.spdxToWebLabelsLicenses(parsedSpdxLicenses); - let licenseCopyUrl = this.copyLicenseFile(licenceFilePath); - scriptSrcData['licenses'].forEach(license => { - license['copy_url'] = licenseCopyUrl; - }); + if (licenceFilePath.indexOf('://') === -1 && !licenceFilePath.startsWith('/')) { + let licenseCopyUrl = this.copyLicenseFile(licenceFilePath); + scriptSrcData['licenses'].forEach(license => { + license['copy_url'] = licenseCopyUrl; + }); + } else { + scriptSrcData['licenses'].forEach(license => { + license['copy_url'] = licenceFilePath; + }); + } if (scriptSrc['path'].indexOf('://') === -1 && !scriptSrc['path'].startsWith('/')) { scriptSrcData['src_url'] = stats.publicPath + path.join(this.weblabelsDirName, scriptSrc['id']); } else { diff --git a/swh/web/assets/config/webpack.config.development.js b/swh/web/assets/config/webpack.config.development.js --- a/swh/web/assets/config/webpack.config.development.js +++ b/swh/web/assets/config/webpack.config.development.js @@ -431,6 +431,14 @@ 'spdxLicenseExpression': 'AGPL-3.0-or-later', 'licenseFilePath': './LICENSE' } + ], + 'https://piwik.inria.fr/matomo.js': [ + { + 'id': 'matomo.js', + 'path': 'https://github.com/matomo-org/matomo/blob/master/js/piwik.js', + 'spdxLicenseExpression': 'BSD-3-Clause', + 'licenseFilePath': 'https://github.com/matomo-org/matomo/blob/master/js/LICENSE.txt' + } ] } ) diff --git a/swh/web/templates/layout.html b/swh/web/templates/layout.html --- a/swh/web/templates/layout.html +++ b/swh/web/templates/layout.html @@ -64,6 +64,25 @@ + {% if site_base_url == "https://archive.softwareheritage.org/" %} + + + + + + {% endif %} +