From a0f65bbdb648af06b0f95beeb5fc99abf2c65723 Mon Sep 17 00:00:00 2001 From: TheManchineel <37479927+TheManchineel@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:15:30 +0100 Subject: [PATCH] fix(build): ensure index.html is not duplicated (lol) --- .github/workflows/gh-pages.yml | 5 +++++ build_docs_v2.py | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 4bb8a64..a0f08ff 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -5,6 +5,11 @@ on: branches: ["main"] paths: - "*/*.md" + - "*/*.jpg" + - "*/*.jpeg" + - "*/*.webp" + - "*/*.png" + - "*/*.gif" - ".github/workflows/gh-pages.yml" workflow_dispatch: diff --git a/build_docs_v2.py b/build_docs_v2.py index 6086a56..a282216 100644 --- a/build_docs_v2.py +++ b/build_docs_v2.py @@ -34,8 +34,11 @@ def build_docs_and_index(): ] ).wait() - with open("/workspace/index.html", "r+") as index_file: + original_html = "" + with open("/workspace/index.html", "r") as index_file: original_html = index_file.read() + + with open("/workspace/index.html", "w") as index_file: index_file.write(original_html.replace("{{{PLACEHOLDER}}}", index_entries.getvalue()))