{% set page_url_parts = page.nb_url.split('/') %} {% set gh_ns = namespace(gh_nb_url='') %} {# Create a namespace to store the variable #} {% for page_url_part in page_url_parts %} {% if loop.index == page_url_parts | length %} {% set gh_ns.gh_nb_url = gh_ns.gh_nb_url + page_url_part %} {% endif %} {% endfor %}
{% include ".icons/material/github.svg" %} View on Github {% include ".icons/simple/googlecolab.svg" %} Try in Colab {% include ".icons/material/download.svg" %} Download notebook