interact.html 1.0 KB

123456789101112131415161718
  1. <!-- INTERACT LINKS -->
  2. {% if page.interact_link %}
  3. {% if site.use_jupyterlab %}
  4. {% assign binder_interact_prefix="urlpath=lab/tree/" %}
  5. {% assign hub_app="lab" %}
  6. {% else %}
  7. {% assign binder_interact_prefix="filepath=" %}
  8. {% assign hub_app="notebook" %}
  9. {% endif %}
  10. {% if site.hub_type == "binder" %}
  11. {% capture interact_url %}v2/gh/{{ site.textbook_repo_org }}/{{ site.textbook_repo_name }}/{{ site.textbook_repo_branch }}?{{ binder_interact_prefix }}{{ page.interact_link | url_encode }}{% endcapture %}
  12. {% elsif site.hub_type == "jupyterhub" %}
  13. {% capture interact_url %}hub/user-redirect/git-pull?repo={{ site.textbook_repo_base }}/{{ site.textbook_repo_org }}/{{ site.textbook_repo_name }}&amp;branch={{ site.textbook_repo_branch }}&amp;subPath={{ page.interact_link | url_encode }}&amp;app={{ hub_app }}{% endcapture %}
  14. {% endif %}
  15. <div class="buttons">
  16. <a class="interact-button" href="{{ site.hub_url }}/{{ interact_url }}">{{ site.interact_text }}</a>
  17. </div>
  18. {% endif %}