File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -29,22 +29,28 @@ function render()
29
29
end
30
30
31
31
function build_search_index (root, docs, config, rootpath)
32
- # npx and npm are distributed as FileProducts,
32
+ # npx and npm are distributed as FileProducts,
33
33
# so the JLL does not bundle environment information into them.
34
34
# To fix this, we wrap all uses of npx and npm inside `node() do ...`
35
35
# which will automatically adjust the necessary environment variables.
36
- node () do
36
+ node () do _
37
37
if ! success (Cmd (` $(npx) pagefind -V` ; dir = root))
38
38
@info " Installing pagefind into $root ."
39
39
if ! success (Cmd (` $(npm) install pagefind` ; dir = root))
40
40
error (" Could not install pagefind." )
41
41
end
42
42
end
43
-
43
+
44
44
pattern = " */{$(join (config. index_versions, " ," )) }/**/*.{html}"
45
-
46
- run (` $(npx) pagefind --site $(root) --glob $(pattern) --root-selector article` )
45
+
46
+ out_path = joinpath (root, " pagefind" )
47
+ mktempdir () do dir
48
+ # pagefind doesn't look at symlinks, so we resolve them here:
49
+ cp (root, dir; follow_symlinks = true , force = true )
50
+ run (` $(npx) pagefind --site $(dir) --output-path $(out_path) --glob $(pattern) --root-selector article` )
51
+ end
47
52
end
53
+
48
54
return nothing
49
55
end
50
56
You can’t perform that action at this time.
0 commit comments