From 971291f650bbbc53cff3ec07b59bc1b793091b31 Mon Sep 17 00:00:00 2001 From: nercone-dev Date: Sat, 18 Apr 2026 14:01:04 +0900 Subject: [PATCH] -- --- public/assets/images/thumbnail/error.svg | 67 +++++++++++++++++++++++ public/assets/images/thumbnail/normal.svg | 55 +++++++++++++++++++ public/assets/thumbnails/error.svg | 59 -------------------- public/assets/thumbnails/normal.svg | 47 ---------------- public/base.html | 4 +- src/nercone_website/server.py | 4 +- 6 files changed, 126 insertions(+), 110 deletions(-) create mode 100644 public/assets/images/thumbnail/error.svg create mode 100644 public/assets/images/thumbnail/normal.svg delete mode 100644 public/assets/thumbnails/error.svg delete mode 100644 public/assets/thumbnails/normal.svg diff --git a/public/assets/images/thumbnail/error.svg b/public/assets/images/thumbnail/error.svg new file mode 100644 index 0000000..9d70884 --- /dev/null +++ b/public/assets/images/thumbnail/error.svg @@ -0,0 +1,67 @@ + + + + + + + + + + + + + ERROR + __PATH__ + __TITLE__ + __DESCRIPTION__ + \ No newline at end of file diff --git a/public/assets/images/thumbnail/normal.svg b/public/assets/images/thumbnail/normal.svg new file mode 100644 index 0000000..09c31d3 --- /dev/null +++ b/public/assets/images/thumbnail/normal.svg @@ -0,0 +1,55 @@ + + + + + + + + + + + + __PATH__ + __TITLE__ + __DESCRIPTION__ + \ No newline at end of file diff --git a/public/assets/thumbnails/error.svg b/public/assets/thumbnails/error.svg deleted file mode 100644 index b3a86d0..0000000 --- a/public/assets/thumbnails/error.svg +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - ERROR - __PATH__ - __TITLE__ - __DESCRIPTION__ - diff --git a/public/assets/thumbnails/normal.svg b/public/assets/thumbnails/normal.svg deleted file mode 100644 index 957704f..0000000 --- a/public/assets/thumbnails/normal.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - __PATH__ - __TITLE__ - __DESCRIPTION__ - diff --git a/public/base.html b/public/base.html index 21ac1f6..56278a7 100644 --- a/public/base.html +++ b/public/base.html @@ -29,14 +29,14 @@ - + - + diff --git a/src/nercone_website/server.py b/src/nercone_website/server.py index 81351f6..7a468a0 100644 --- a/src/nercone_website/server.py +++ b/src/nercone_website/server.py @@ -101,7 +101,7 @@ welcome to nercone.dev! async def fake_error_page(request: Request, code: str): return error_page(templates=templates, request=request, status_code=int(code)) -@app.api_route("/assets/thumbnail/{path:path}", methods=["GET"]) +@app.api_route("/assets/images/thumbnail/{path:path}", methods=["GET"]) async def thumbnail(request: Request, path: str) -> Response: title = request.query_params.get("title", "Untitled Page") description = request.query_params.get("description", "No description.") @@ -113,7 +113,7 @@ async def thumbnail(request: Request, path: str) -> Response: svg_filename = "error.svg" if template_type == "error" else "normal.svg" fonts_dir = Path.cwd().joinpath("public", "assets", "fonts") - svg_path = Path.cwd().joinpath("public", "assets", "thumbnails", svg_filename) + svg_path = Path.cwd().joinpath("public", "assets", "images", "thumbnail", svg_filename) svg = svg_path.read_text(encoding="utf-8") svg = svg.replace("__PATH__", escape(path_display)) svg = svg.replace("__TITLE__", escape(title))