From 8384c7872e79aa8a34eb73a8cbe80af3222e3334 Mon Sep 17 00:00:00 2001 From: Michele Ceriotti Date: Mon, 7 Oct 2024 08:00:09 +0200 Subject: [PATCH] Fix paths for recipe-of-the-day Ooooops! --- noxfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/noxfile.py b/noxfile.py index dd5cb173..ef7a6a45 100644 --- a/noxfile.py +++ b/noxfile.py @@ -386,9 +386,9 @@ def build_docs(session): # Prepare the examples data for JavaScript examples_data = [] for _, metadata in sorted(all_examples_rst.items(), key=lambda kw: kw[1]["title"]): - # Adjust the thumbnail and ref paths to be relative to the root - metadata["thumbnail"] = "/_images/" + os.path.split(metadata["thumbnail"])[-1] - metadata["ref"] = "/" + metadata["ref"] + ".html" + # use relative paths so it works both locally and when deployed + metadata["thumbnail"] = "_images/" + os.path.split(metadata["thumbnail"])[-1] + metadata["ref"] = metadata["ref"] + ".html" examples_data.append(metadata) # Write the data to examples_data.json in the _static directory