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.

Move image assets to src/assets and update references (#14)

Myles Scolnickc01ac89d56fd
diff --git a/frontend/index.html b/frontend/index.html
index 72487a6b54..5e81e365b4 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -3,8 +3,10 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
- <link rel="preload" href="/gradient.png" as="image" />
- <link rel="preload" href="/noise.png" as="image" />
+ <!-- Preload is necessary because we show this when we disconnect from the server,
+ but at that point we cannot load these images from the server -->
+ <link rel="preload" href="/src/assets/gradient.png" as="image" />
+ <link rel="preload" href="/src/assets/noise.png" as="image" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="a marimo app" />
diff --git a/frontend/public/gradient.png b/frontend/src/assets/gradient.png
similarity index 100%
rename from frontend/public/gradient.png
rename to frontend/src/assets/gradient.png
diff --git a/frontend/public/noise.png b/frontend/src/assets/noise.png
similarity index 100%
rename from frontend/public/noise.png
rename to frontend/src/assets/noise.png
diff --git a/frontend/src/css/App.css b/frontend/src/css/App.css
index f9aacbc055..79e0aaeaaf 100644
--- a/frontend/src/css/App.css
+++ b/frontend/src/css/App.css
@@ -1,8 +1,8 @@
-@import url("Header.css");
-@import url("Cell.css");
-@import url("md.css");
-@import url("table.css");
-@import url("CodeMirrorSearchPanel.css");
+@import url("./Header.css");
+@import url("./Cell.css");
+@import url("./md.css");
+@import url("./table.css");
+@import url("./CodeMirrorSearchPanel.css");
/* stylelint-disable unit-allowed-list */
@@ -62,7 +62,7 @@ html {
/* Use an image because hard to get consistent result across browsers with
* css gradients. */
- background-image: url("/gradient.png");
+ background-image: url("../assets/gradient.png");
background-repeat: no-repeat;
/* Scale gradient with zoom in/out. */
@@ -76,7 +76,7 @@ html {
width: 100vw;
height: 100vh;
z-index: -1;
- background-image: url("/noise.png");
+ background-image: url("../assets/noise.png");
background-repeat: repeat;
opacity: 0.5;
}
diff --git a/marimo/_server/server.py b/marimo/_server/server.py
index 55fb071ea1..6ed3d5e18b 100644
--- a/marimo/_server/server.py
+++ b/marimo/_server/server.py
@@ -243,22 +243,7 @@ async def start_server(
{"path": root},
),
(
- r"/(noise\.png)",
- tornado.web.StaticFileHandler,
- {"path": root},
- ),
- (
- r"/(gradient\.png)",
- tornado.web.StaticFileHandler,
- {"path": root},
- ),
- (
- r"/(android-chrome-192x192\.png)",
- tornado.web.StaticFileHandler,
- {"path": root},
- ),
- (
- r"/(android-chrome-512x512\.png)",
+ r"/(android-chrome-(192x192|512x512)\.png)",
tornado.web.StaticFileHandler,
{"path": root},
),