diff --git a/src/MultiDocumenter.jl b/src/MultiDocumenter.jl index d4bd9810..7ea3bd04 100644 --- a/src/MultiDocumenter.jl +++ b/src/MultiDocumenter.jl @@ -231,13 +231,16 @@ function make_global_stylesheet(custom_stylesheets, path) out = [] for stylesheet in custom_stylesheets + stylesheet = startswith(stylesheet, r"https?://") ? + stylesheet : + replace(joinpath(path, stylesheet), raw"\\" => "/") style = Gumbo.HTMLElement{:link}( [], Gumbo.NullNode(), Dict( "rel" => "stylesheet", "type" => "text/css", - "href" => string(path, "/", stylesheet), + "href" => stylesheet, ), ) push!(out, style) @@ -250,11 +253,14 @@ function make_global_scripts(custom_scripts, path) out = [] for script in custom_scripts + script = startswith(script, r"https?://") ? + script : + replace(joinpath(path, script), raw"\\" => "/") js = Gumbo.HTMLElement{:script}( [], Gumbo.NullNode(), Dict( - "src" => string(path, "/", script), + "src" => script, "type" => "text/javascript", "charset" => "utf-8", ), diff --git a/src/renderers.jl b/src/renderers.jl index 243ef111..c58e5bec 100644 --- a/src/renderers.jl +++ b/src/renderers.jl @@ -1,9 +1,15 @@ render(::Nothing, args...) = nothing function render(brand_image::BrandImage, dir, thispagepath) + href = startswith(brand_image.path, "https?://") ? + brand_image.path : + relpath(joinpath(dir, brand_image.path), thispagepath) + src = startswith(brand_image.imagepath, "https?://") ? + brand_image.imagepath : + relpath(joinpath(dir, brand_image.imagepath), thispagepath) return @htl """ - - home + + home """ end