@@ -411,7 +411,7 @@ def deploy_thumbnails(rdf_like: Dict[str, Any], dist: Path, gh_pages: Path, reso
411411 if not isinstance (cover_url , str ) or cover_url .startswith (DEPLOYED_BASE_URL ):
412412 continue # invalid or already cached
413413
414- cover_file_name = PurePosixPath (urlsplit (cover_url ).path ).name
414+ cover_file_name = PurePosixPath (urlsplit (cover_url . strip ( "/content" ) ).path ).name
415415 if not (gh_pages / cover_file_name ).exists ():
416416 try :
417417 downloaded_cover = Path (pooch .retrieve (cover_url , None )) # type: ignore
@@ -430,7 +430,7 @@ def deploy_thumbnails(rdf_like: Dict[str, Any], dist: Path, gh_pages: Path, reso
430430 continue
431431
432432 icon = badge .get ("icon" )
433- if not isinstance (icon , str ) or not icon .startswith ("https://zenodo.org/api/files/ " ):
433+ if not isinstance (icon , str ) or not icon .startswith ("https://zenodo.org/api" ):
434434 # only cache badges stored on zenodo
435435 continue
436436
@@ -440,6 +440,7 @@ def deploy_thumbnails(rdf_like: Dict[str, Any], dist: Path, gh_pages: Path, reso
440440 warnings .warn (str (e ))
441441 continue
442442
443- resized_icon = downsize_image (downloaded_icon , dist , size = (320 , 320 ))
443+ icon_file_name = PurePosixPath (urlsplit (icon .strip ("/content" )).path ).name
444+ downsize_image (downloaded_icon , dist / icon_file_name , size = (320 , 320 ))
444445
445- rdf_like ["badges" ][i ]["icon" ] = f"{ DEPLOYED_BASE_URL } /rdfs/{ resource_id } /{ version_id } /{ resized_icon . name } "
446+ rdf_like ["badges" ][i ]["icon" ] = f"{ DEPLOYED_BASE_URL } /rdfs/{ resource_id } /{ version_id } /{ icon_file_name } "
0 commit comments