File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,13 @@ def search_img_by_repo_name(self):
73
73
else :
74
74
# If not overridden, the (thebe/binder)repo in myst.yml takes precedence
75
75
if self .get_myst_yml_as_dict ():
76
- src_name = self .myst_yml_dict ['project' ]['thebe' ]['binder' ]['repo' ]
76
+ src_name = None
77
+ if 'thebe' in self .myst_yml_dict .get ('project' , {}) and 'binder' in self .myst_yml_dict ['project' ]['thebe' ]:
78
+ src_name = self .myst_yml_dict ['project' ]['thebe' ]['binder' ].get ('repo' )
79
+ elif 'github' in self .myst_yml_dict .get ('project' , {}):
80
+ repo_url = self .myst_yml_dict ['project' ]['github' ].get ('repo' , '' ).rstrip ('/' )
81
+ src_name = '/' .join (repo_url .split ('/' )[- 2 :]) if len (repo_url .split ('/' )) >= 2 else repo_url
82
+
77
83
if src_name :
78
84
self .cprint (f"🥳 Using project::thebe::binder::repo from myst config to look for 🐳 in { self .registry_url } : { src_name } " ,"light_blue" )
79
85
else :
You can’t perform that action at this time.
0 commit comments