Skip to content

Commit 370a9a4

Browse files
authored
Update ci.yml
1 parent 4764e7d commit 370a9a4

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,35 @@ jobs:
2525
- run: pip install mkdocs-git-revision-date-localized-plugin
2626
- run: pip install mkdocs-glightbox
2727
- run: pip install mkdocs-awesome-pages-plugin
28-
- run: mkdocs gh-deploy --force
28+
29+
- name: Build site
30+
run: mkdocs build
31+
32+
- name: Patch index.html with correct search worker
33+
run: |
34+
python <<EOF
35+
import re
36+
from pathlib import Path
37+
38+
site_dir = Path("site")
39+
worker_dir = site_dir / "assets" / "javascripts" / "workers"
40+
index_file = site_dir / "index.html"
41+
42+
try:
43+
worker_file = next(worker_dir.glob("search.*.min.js"))
44+
html = index_file.read_text()
45+
46+
html = re.sub(
47+
r'"search":\s*"(?:/)?assets/javascripts/workers/search\.[^"]+\.min\.js"',
48+
f'"search": "/assets/javascripts/workers/{worker_file.name}"',
49+
html
50+
)
51+
52+
index_file.write_text(html)
53+
print(f"✅ Patched index.html with search worker: {worker_file.name}")
54+
except Exception as e:
55+
print(f"⚠️ Failed to patch index.html: {e}")
56+
EOF
57+
58+
- name: Deploy site
59+
run: mkdocs gh-deploy --force

0 commit comments

Comments
 (0)