Serve favicon from static public assets
Some checks failed
docker / build-and-push (push) Has been cancelled
Some checks failed
docker / build-and-push (push) Has been cancelled
This commit is contained in:
@@ -16,6 +16,7 @@ from fastapi.staticfiles import StaticFiles
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
STATIC_DIR = Path("frontend/dist")
|
STATIC_DIR = Path("frontend/dist")
|
||||||
|
PUBLIC_DIR = Path("public")
|
||||||
SESSION_COOKIE = "jellomator_session"
|
SESSION_COOKIE = "jellomator_session"
|
||||||
DB_HOST = os.getenv("DB_HOST", "mariadb")
|
DB_HOST = os.getenv("DB_HOST", "mariadb")
|
||||||
DB_PORT = int(os.getenv("DB_PORT", "3306"))
|
DB_PORT = int(os.getenv("DB_PORT", "3306"))
|
||||||
@@ -295,6 +296,8 @@ def update_link(
|
|||||||
|
|
||||||
if STATIC_DIR.exists():
|
if STATIC_DIR.exists():
|
||||||
app.mount("/assets", StaticFiles(directory=STATIC_DIR / "assets"), name="assets")
|
app.mount("/assets", StaticFiles(directory=STATIC_DIR / "assets"), name="assets")
|
||||||
|
if PUBLIC_DIR.exists():
|
||||||
|
app.mount("/static", StaticFiles(directory=PUBLIC_DIR), name="public")
|
||||||
|
|
||||||
|
|
||||||
@app.get("/{path:path}")
|
@app.get("/{path:path}")
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta name="theme-color" content="#020617" />
|
<meta name="theme-color" content="#020617" />
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/jellomator.png" />
|
<link rel="icon" type="image/png" sizes="32x32" href="/static/jellomator.png" />
|
||||||
<link rel="shortcut icon" href="/jellomator.png" />
|
<link rel="shortcut icon" href="/static/jellomator.png" />
|
||||||
<link rel="apple-touch-icon" href="/jellomator.png" />
|
<link rel="apple-touch-icon" href="/static/jellomator.png" />
|
||||||
<title>Jellomator</title>
|
<title>Jellomator</title>
|
||||||
<script>
|
<script>
|
||||||
if (localStorage.theme === 'light') document.documentElement.classList.remove('dark');
|
if (localStorage.theme === 'light') document.documentElement.classList.remove('dark');
|
||||||
|
|||||||
Reference in New Issue
Block a user