Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

improve: include .nojekyll file in assets export (#3314)

Akshay Agrawal25469010505f
diff --git a/marimo/_cli/export/commands.py b/marimo/_cli/export/commands.py
index 91d54bae93..52bcad4b4b 100644
--- a/marimo/_cli/export/commands.py
+++ b/marimo/_cli/export/commands.py
@@ -3,7 +3,8 @@ from __future__ import annotations
import asyncio
import os
-from typing import TYPE_CHECKING, Callable, Literal, Optional
+from pathlib import Path
+from typing import Callable, Literal, Optional
import click
@@ -25,9 +26,6 @@ from marimo._utils.file_watcher import FileWatcher
from marimo._utils.marimo_path import MarimoPath
from marimo._utils.paths import maybe_make_dirs
-if TYPE_CHECKING:
- from pathlib import Path
-
_watch_message = (
"Watch notebook for changes and regenerate the output on modification. "
"If watchdog is installed, it will be used to watch the file. "
@@ -451,6 +449,11 @@ def html_wasm(
# Export assets first
Exporter().export_assets(out_dir, ignore_index_html=ignore_index_html)
+
+ # Create .nojekyll file to prevent GitHub Pages from interfering with asset
+ # resolution
+ (Path(out_dir) / ".nojekyll").touch()
+
echo(
f"Assets copied to {green(out_dir)}. These assets are required for the "
"notebook to run in the browser."
diff --git a/tests/_cli/test_cli_export.py b/tests/_cli/test_cli_export.py
index df32e6a628..9406d182af 100644
--- a/tests/_cli/test_cli_export.py
+++ b/tests/_cli/test_cli_export.py
@@ -85,6 +85,7 @@ class TestExportHTML:
not in html
)
assert "<marimo-wasm" in html
+ assert Path(out_dir / ".nojekyll").exists()
@staticmethod
def test_cli_export_html_wasm_output_is_file(