Skip to content

Commit

Permalink
switch binder badges to nbclassic
Browse files Browse the repository at this point in the history
  • Loading branch information
LoicGrobol committed Mar 19, 2024
1 parent ff879dd commit 24273cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _plugins/notebooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def render(context)
repo_dir = context['site']['repository'].split("/").last
urlpath = (
"?repo=#{ERB::Util.url_encode("https://github.com/" + context['site']['repository'])}" +
"&urlpath=#{ERB::Util.url_encode("tree/#{repo_dir}/#{@notebook_path}")}" +
"&urlpath=#{ERB::Util.url_encode("/nbclassic/tree/#{repo_dir}/#{@notebook_path}")}" +
"&branch=#{context['site']['repo_branch']}"
)
urlpath_escaped = ERB::Util.url_encode(urlpath)
Expand All @@ -20,7 +20,7 @@ def render(context)
"?urlpath=git-pull#{urlpath_escaped})"
)
else
res = "[![Launch in Binder badge](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/#{context['site']['repository']}/#{context['site']['repo_branch']}?urlpath=tree/#{@notebook_path})"
res = "[![Launch in Binder badge](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/#{context['site']['repository']}/#{context['site']['repo_branch']}?urlpath=nbclassic/tree/#{@notebook_path})"
end
return res
end
Expand All @@ -35,7 +35,7 @@ def initialize(tag_name, notebook_path, tokens)
end

def render(context)
res = "[![Launch in Binder badge](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/#{context['site']['repository']}/#{context['site']['repo_branch']}?urlpath=tree/#{@notebook_path})"
res = "[![Launch in Binder badge](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/#{context['site']['repository']}/#{context['site']['repo_branch']}?urlpath=nbclassic/tree/#{@notebook_path})"
return res
end
end
Expand Down

0 comments on commit 24273cb

Please sign in to comment.