Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emulate upstream config-utils relative path rewriting #138

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
patch relative urls first, then overload with voici-specific paths
bollwyvl committed Jan 15, 2025
commit a5d9a7b81e0ef5740113b44d27cb86e8df0a7edf
7 changes: 5 additions & 2 deletions python/voici-core/voici_core/tree_exporter.py
Original file line number Diff line number Diff line change
@@ -47,14 +47,17 @@ def patch_page_config(

voici_url_prefix = "../" * (1 + len(relative_path.parts))
base_url_prefix = f"../{voici_url_prefix}"
# emulate upstream ``config-utils.js``
patch_relative_urls(page_config_copy, base_url_prefix)
page_config_copy.update(
# Align the base url with the relative path
baseUrl=base_url_prefix,
# Grabbing from the Voici static folder
fullStaticUrl=f"{voici_url_prefix}build",
# The Themes URL will be joined with the base URL in the
# JupyterLite main application
themesUrl="./build/themes",
)
# emulate upstream ``config-utils.js``
patch_relative_urls(page_config_copy, base_url_prefix)

if config.theme == "light":
themeName = "JupyterLab Light"