From ddfa45eeb5b4fb44eb770753f73eb1fa2a2634b3 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Mon, 2 May 2022 20:14:48 -0400 Subject: [PATCH] Fix URLs in docs generation --- docs/src/lib.rs | 9 +++------ www/build.sh | 5 +++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/src/lib.rs b/docs/src/lib.rs index 93a8756732..fc348557cf 100644 --- a/docs/src/lib.rs +++ b/docs/src/lib.rs @@ -56,12 +56,9 @@ pub fn generate_docs_html(filenames: Vec, build_dir: &Path) { .expect("TODO gracefully handle failing to make the favicon"); let template_html = include_str!("./static/index.html") - .replace("", &format!("{}search.js", base_url())) - .replace("", &format!("{}styles.css", base_url())) - .replace( - "", - &format!("{}favicon.svg", base_url()), - ) + .replace("", "/search.js") + .replace("", "/styles.css") + .replace("", "/favicon.svg") .replace( "", render_sidebar(package.modules.iter().flat_map(|loaded_module| { diff --git a/www/build.sh b/www/build.sh index cf27ae6b40..2d5d179ef0 100755 --- a/www/build.sh +++ b/www/build.sh @@ -41,7 +41,7 @@ RUSTFLAGS=-Awarnings # We set ROC_DOCS_ROOT_DIR=builtins so that links will be generated relative to # "/builtins/" rather than "/" - which is what we want based on how the server # is set up to serve them. -ROC_DOCS_URL_ROOT=builtins +export ROC_DOCS_URL_ROOT=/builtins # These just need to be defined so that some env! macros don't fail. BUILTINS_WASM32_O="" @@ -51,5 +51,6 @@ BUILTINS_HOST_O="" # "llvm" feature and therefore don't depend on LLVM being installed on the # system. (Netlify's build servers have Rust installed, but not LLVM.) cargo run -p roc_cli --no-default-features docs compiler/builtins/roc/*.roc -mv generated-docs/ www/build/builtins +mv generated-docs/*.* www/build # move all the .js, .css, etc. files to build/ +mv generated-docs/ www/build/builtins # move all the folders to build/builtins/ popd