diff options
author | Manuel Woelker <github@manuel.woelker.org> | 2020-06-07 14:14:35 +0200 |
---|---|---|
committer | Manuel Woelker <github@manuel.woelker.org> | 2020-06-10 12:46:23 +0200 |
commit | bff36e722958d28e3e8c991283250d1e3b50434f (patch) | |
tree | b82968468e07828c4d0b3db2b7d5d99326c1aecf /src/config.rs | |
parent | cda28bb618275cfc5e442f4c6b97afd7a1c00404 (diff) |
Add the config parameter output.html.site-url to set base url of the 404 page, making links and relative script/css loads behave correctly even in subdirectory paths
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 8a8f6ce5..b955e352 100644 --- a/src/config.rs +++ b/src/config.rs @@ -511,6 +511,8 @@ pub struct HtmlConfig { pub input_404: Option<String>, /// Output path for 404.html file, defaults to 404.html, set to "" to disable 404 file output pub output_404: Option<String>, + /// Absolute url to site, used to emit correct paths for the 404 page, which might be accessed in a deeply nested directory + pub site_url: Option<String>, /// This is used as a bit of a workaround for the `mdbook serve` command. /// Basically, because you set the websocket port from the command line, the /// `mdbook serve` command needs a way to let the HTML renderer know where @@ -544,6 +546,7 @@ impl Default for HtmlConfig { git_repository_icon: None, input_404: None, output_404: None, + site_url: None, livereload_url: None, redirect: HashMap::new(), } |