@@ -89,7 +89,8 @@ const DEFAULT_ENGINE = SearchConfig(index_versions = ["stable", "dev"], engine =
8989 custom_scripts = [],
9090 search_engine = SearchConfig(),
9191 prettyurls = true,
92- rootpath = "/"
92+ rootpath = "/",
93+ hide_previews = true,
9394 )
9495
9596Aggregates multiple Documenter.jl-based documentation pages `docs` into `outdir`.
@@ -102,7 +103,8 @@ Aggregates multiple Documenter.jl-based documentation pages `docs` into `outdir`
102103 `Docs.HTML` objects are inserted as the content of inline scripts.
103104- `search_engine` inserts a global search bar if not `false`. See [`SearchConfig`](@ref) for more details.
104105- `prettyurls` removes all `index.html` suffixes from links in the global navigation.
105- -`rootpath` is the path your site ends up being deployed at, e.g. `/foo/` if it's hosted at `https://bar.com/foo`
106+ - `rootpath` is the path your site ends up being deployed at, e.g. `/foo/` if it's hosted at `https://bar.com/foo`
107+ - `hide_previews` removes preview builds from the aggregated documentation.
106108"""
107109function make (
108110 outdir,
@@ -114,10 +116,11 @@ function make(
114116 search_engine = DEFAULT_ENGINE,
115117 prettyurls = true ,
116118 rootpath = " /" ,
119+ hide_previews = true ,
117120)
118121 maybe_clone (flatten_multidocrefs (docs))
119122
120- dir = make_output_structure (flatten_multidocrefs (docs), prettyurls)
123+ dir = make_output_structure (flatten_multidocrefs (docs), prettyurls, hide_previews )
121124 out_assets = joinpath (dir, " assets" )
122125 if assets_dir != = nothing && isdir (assets_dir)
123126 cp (assets_dir, out_assets)
@@ -189,7 +192,7 @@ function maybe_clone(docs::Vector{MultiDocRef})
189192 end
190193end
191194
192- function make_output_structure (docs:: Vector{MultiDocRef} , prettyurls)
195+ function make_output_structure (docs:: Vector{MultiDocRef} , prettyurls, hide_previews )
193196 dir = mktempdir ()
194197
195198 for doc in docs
@@ -202,6 +205,11 @@ function make_output_structure(docs::Vector{MultiDocRef}, prettyurls)
202205 if isdir (gitpath)
203206 rm (gitpath, recursive = true )
204207 end
208+
209+ previewpath = joinpath (outpath, " previews" )
210+ if hide_previews && isdir (previewpath)
211+ rm (previewpath, recursive = true )
212+ end
205213 end
206214
207215 open (joinpath (dir, " index.html" ), " w" ) do io
0 commit comments