Use query string parameters for retrieving title badge...

Fixes badges not displaying when dash (-) in title.

Reference: https://github.com/minetest/contentdb/issues/307
This commit is contained in:
Jordan Irwin 2021-06-16 23:48:20 -07:00
parent 231c2a3a1e
commit a55be574b1
1 changed files with 1 additions and 1 deletions

View File

@ -182,7 +182,7 @@ def view(package):
@is_package_page
def shield(package, type):
if type == "title":
url = "https://img.shields.io/badge/ContentDB-{}-{}" \
url = "https://img.shields.io/static/v1?label=ContentDB&message={}&color={}" \
.format(urlescape(package.title), urlescape("#375a7f"))
elif type == "downloads":
#api_url = abs_url_for("api.package", author=package.author.username, name=package.name)