Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,14 @@ def _nav_context(app, pagename, templatename, context, doctree):
if pagename in _LANDING_PAGES:
context["body_class"] = "pky-landing"

# Tutorial pages: derive the action-toolbar links from the catalogue path.
# Tutorial pages: derive the action-toolbar links from the catalogue path. A tutorial's Colab and
# Notebook buttons go live as soon as it ships a self-contained tutorial.ipynb in its own folder.
mapped = gallery_pagename_to_tutorial(pagename)
if mapped:
rel_path, slug = mapped
draft = _DRAFT_BY_SLUG.get(slug, False)
context["pky_tutorial"] = tutorial_actions(rel_path, slug, draft=draft)
has_notebook = (REPO_ROOT / rel_path / "tutorial.ipynb").exists()
context["pky_tutorial"] = tutorial_actions(rel_path, slug, draft=draft, has_notebook=has_notebook)
context["pky_tutorial_draft"] = draft

# Left-sidebar context label ("Tutorials in General" / "More General tutorials"), data-driven.
Expand Down
Loading
Loading