From 26a261d5dca98436eb44e4d718551d6cc8ac3b9d Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Mon, 6 Mar 2023 01:04:41 -0800 Subject: [PATCH] MNT: more flexible static (#1221) --- src/pydata_sphinx_theme/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pydata_sphinx_theme/__init__.py b/src/pydata_sphinx_theme/__init__.py index e52b385e0..01ce08bed 100644 --- a/src/pydata_sphinx_theme/__init__.py +++ b/src/pydata_sphinx_theme/__init__.py @@ -1168,6 +1168,10 @@ def copy_logo_images(app: Sphinx, exception=None) -> None: path_image = logo.get(f"image_{kind}") if not path_image or isurl(path_image): continue + if (staticdir / Path(path_image).name).exists(): + # file already exists in static dir e.g. because a theme has + # bundled the logo and installed it there + continue if not (Path(app.srcdir) / path_image).exists(): logger.warning(f"Path to {kind} image logo does not exist: {path_image}") # Ensure templates cannot be passed for logo path to avoid security vulnerability