Skip to content

Commit 5e18efc

Browse files
committed
fix: resolve symlinks for pagefind index
1 parent 1c9d75f commit 5e18efc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/search/pagefind.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ function build_search_index(root, docs, config, rootpath)
3838

3939
pattern = "*/{$(join(config.index_versions, ","))}/**/*.{html}"
4040

41-
run(`$(npx) pagefind --site $(root) --glob $(pattern) --root-selector article`)
41+
out_path = joinpath(root, "pagefind")
42+
mktempdir() do dir
43+
# pagefind doesn't look at symlinks, so we resolve them here:
44+
cp(root, dir; follow_symlinks = true, force = true)
45+
run(`$(npx) pagefind --site $(dir) --output-path $(out_path) --glob $(pattern) --root-selector article`)
46+
end
47+
4248
return nothing
4349
end
4450

0 commit comments

Comments
 (0)