File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change 25
25
- run : pip install mkdocs-git-revision-date-localized-plugin
26
26
- run : pip install mkdocs-glightbox
27
27
- 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
You can’t perform that action at this time.
0 commit comments