@@ -179,9 +179,6 @@ function preprocess_source_index()
179179 return true
180180end
181181
182- # Run preprocessing on source files before makedocs()
183- preprocess_source_index ()
184-
185182# Fix VitePress base path for dual deployment
186183function fix_vitepress_base_path ()
187184 deployment_target = get (ENV , " DEPLOYMENT_TARGET" , " astroautomata" )
@@ -193,14 +190,8 @@ function fix_vitepress_base_path()
193190 " /SymbolicRegression.jl/dev/"
194191 end
195192
196- # Find and fix VitePress config files
197- is_production = get (ENV , " DOCUMENTER_PRODUCTION" , " false" ) == " true"
198- build_subdir = is_production ? " 1" : " ."
199-
200- config_paths = [
201- joinpath (@__DIR__ , " build" , " .documenter" , " .vitepress" , " config.mts" ),
202- joinpath (@__DIR__ , " build" , build_subdir, " .vitepress" , " config.mts" ),
203- ]
193+ # Find and fix VitePress SOURCE config file (before build)
194+ config_paths = [joinpath (@__DIR__ , " src" , " .vitepress" , " config.mts" )]
204195
205196 for config_path in config_paths
206197 if isfile (config_path)
@@ -219,6 +210,12 @@ function fix_vitepress_base_path()
219210 end
220211end
221212
213+ # Run preprocessing on source files before makedocs()
214+ preprocess_source_index ()
215+
216+ # Fix VitePress base path BEFORE makedocs() - this is crucial for timing!
217+ fix_vitepress_base_path ()
218+
222219# Configure deployment based on target
223220deployment_target = get (ENV , " DEPLOYMENT_TARGET" , " astroautomata" )
224221
@@ -290,8 +287,7 @@ makedocs(;
290287# This runs after VitePress build to fix any final rendering issues
291288post_process_vitepress_index ()
292289
293- # Fix VitePress base path for dual deployment
294- fix_vitepress_base_path ()
290+ # Fix VitePress base path BEFORE building (moved to before makedocs)
295291
296292# Additional post-processing for VitePress production build issues
297293function fix_vitepress_production_output ()
0 commit comments