Add a favicon
Simple SVG icon matching the app's look: a link/chain glyph in white on the indigo accent color, same rounded-square shape as the card avatars. Mounts a new /static route via StaticFiles and references it from base.html's <head>. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ from urllib.parse import quote, urlparse
|
||||
|
||||
from fastapi import Depends, FastAPI, File, Form, Request, UploadFile
|
||||
from fastapi.responses import HTMLResponse, RedirectResponse, Response
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from markupsafe import Markup
|
||||
from sqlalchemy import func, select, text
|
||||
@@ -45,6 +46,9 @@ if config.DATABASE_URL.startswith("sqlite"):
|
||||
|
||||
app = FastAPI(title="LinkVault")
|
||||
app.add_middleware(SessionMiddleware, secret_key=config.SECRET_KEY, max_age=60 * 60 * 24 * 14)
|
||||
app.mount(
|
||||
"/static", StaticFiles(directory=str(Path(__file__).parent / "static")), name="static"
|
||||
)
|
||||
|
||||
templates = Jinja2Templates(directory=str(Path(__file__).parent / "templates"))
|
||||
templates.env.globals.update(
|
||||
|
||||
Reference in New Issue
Block a user