|
@@ -9,13 +9,12 @@ if TYPE_CHECKING:
|
|
|
from .page import page
|
|
|
|
|
|
|
|
|
-def create_favicon_routes() -> None:
|
|
|
+def create_favicon_route(path: str, favicon: Optional[str]) -> None:
|
|
|
+ if favicon and is_remote_url(favicon):
|
|
|
+ return
|
|
|
fallback = Path(__file__).parent / 'static' / 'favicon.ico'
|
|
|
- for path, favicon in globals.favicons.items():
|
|
|
- if favicon and is_remote_url(favicon):
|
|
|
- continue
|
|
|
- globals.app.add_route(f'{"" if path == "/" else path}/favicon.ico',
|
|
|
- lambda _, favicon=favicon or globals.favicon or fallback: FileResponse(favicon))
|
|
|
+ globals.app.add_route(f'{"" if path == "/" else path}/favicon.ico',
|
|
|
+ lambda _: FileResponse(favicon or globals.favicon or fallback))
|
|
|
|
|
|
|
|
|
def get_favicon_url(page: 'page', prefix: str) -> str:
|