{% if site.use_binder_button %}

{% if site.use_jupyterlab %}
    {% assign binder_interact_prefix="urlpath=lab/tree/" %}
{% else %}
    {% assign binder_interact_prefix="filepath=" %}
{% endif %}

{% capture interact_url_binder %}v2/git/https%3A%2F%2Fgit.cmp.uea.ac.uk%2F{{ site.binder_repo_org }}%2F{{ site.binder_repo_name }}/{{ site.binder_repo_branch }}?{{ binder_interact_prefix }}{{ page.interact_link | url_encode }}{% endcapture %}
{% capture interact_icon_binder %}{{ site.images_url | relative_url }}/logo_binder.svg{% endcapture %}

<a href="{{ site.binderhub_url }}/{{ interact_url_binder }}"><button class="interact-button" id="interact-button-binder"><img class="interact-button-logo" src="{{ interact_icon_binder }}" alt="Interact" />{{ site.binderhub_interact_text }}</button></a>

{%- endif %}
