From 1da2fff706fbdd78fd8d6acd69d1b687d2850044 Mon Sep 17 00:00:00 2001 From: Ben Wishovich Date: Sat, 2 Mar 2024 17:57:20 -0800 Subject: [PATCH] Fix missed stuff (#2398) --- integrations/utils/src/lib.rs | 2 +- leptos_config/src/lib.rs | 19 ++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/integrations/utils/src/lib.rs b/integrations/utils/src/lib.rs index 49493da74..5524d7da6 100644 --- a/integrations/utils/src/lib.rs +++ b/integrations/utils/src/lib.rs @@ -150,7 +150,7 @@ fn get_hashes(options: &LeptosOptions) -> (String, String, String) { ("css".to_string(), "".to_string()), ]); - if options.frontend_files_content_hashes { + if options.hash_files { let hash_path = env::current_exe() .map(|path| { path.parent().map(|p| p.to_path_buf()).unwrap_or_default() diff --git a/leptos_config/src/lib.rs b/leptos_config/src/lib.rs index 96f89af3e..81f9255d1 100644 --- a/leptos_config/src/lib.rs +++ b/leptos_config/src/lib.rs @@ -76,9 +76,9 @@ pub struct LeptosOptions { pub hash_file: String, /// If true, hashes will be generated for all files in the site_root and added to their file names. /// Defaults to `true`. - #[builder(default = default_frontend_files_content_hashes())] - #[serde(default = "default_frontend_files_content_hashes")] - pub frontend_files_content_hashes: bool, + #[builder(default = default_hash_files())] + #[serde(default = "default_hash_files")] + pub hash_files: bool, } impl LeptosOptions { @@ -118,14 +118,7 @@ impl LeptosOptions { )?, not_found_path: env_w_default("LEPTOS_NOT_FOUND_PATH", "/404")?, hash_file: env_w_default("LEPTOS_HASH_FILE_NAME", "hash.txt")?, - frontend_files_content_hashes: env_w_default( - "LEPTOS_FRONTEND_FILES_CONTENT_HASHES", - "ON", - )? - .to_uppercase() - .replace("ON", "true") - .replace("OFF", "false") - .parse()?, + hash_files: env_w_default("LEPTOS_HASH_FILES", "false")?.parse()?, }) } } @@ -168,8 +161,8 @@ fn default_hash_file_name() -> String { "hash.txt".to_string() } -fn default_frontend_files_content_hashes() -> bool { - true +fn default_hash_files() -> bool { + false } fn env_wo_default(key: &str) -> Result, LeptosConfigError> {