diff --git a/docs/source/_ext/show_on_colaboratory.py b/docs/source/_ext/show_on_colaboratory.py index 712ce6c..966e05c 100644 --- a/docs/source/_ext/show_on_colaboratory.py +++ b/docs/source/_ext/show_on_colaboratory.py @@ -21,6 +21,9 @@ def get_colaboratory_url(path): def html_page_context(app, pagename, templatename, context, doctree): + if templatename != 'page.html': + return + path = os.path.relpath(doctree.get('source'), app.builder.srcdir).replace('notebook/', '') show_url = get_colaboratory_url(path)