@@ -47,7 +47,7 @@ use ws::{Message, Sender, WebSocket};
47
47
48
48
use errors:: { anyhow, Context , Error , Result } ;
49
49
use site:: sass:: compile_sass;
50
- use site:: { Site , SITE_CONTENT } ;
50
+ use site:: { BuildMode , Site , SITE_CONTENT } ;
51
51
use utils:: fs:: { clean_site_output_folder, copy_file, create_directory} ;
52
52
53
53
use crate :: fs_utils:: { filter_events, ChangeKind , SimpleFileSystemEventKind } ;
@@ -367,6 +367,7 @@ fn create_new_site(
367
367
base_url : Option < & str > ,
368
368
config_file : & Path ,
369
369
include_drafts : bool ,
370
+ store_html : bool ,
370
371
mut no_port_append : bool ,
371
372
ws_port : Option < u16 > ,
372
373
) -> Result < ( Site , SocketAddr , String ) > {
@@ -390,7 +391,7 @@ fn create_new_site(
390
391
constructed_base_url. truncate ( constructed_base_url. len ( ) - 1 ) ;
391
392
}
392
393
393
- site. enable_serve_mode ( ) ;
394
+ site. enable_serve_mode ( if store_html { BuildMode :: Both } else { BuildMode :: Memory } ) ;
394
395
site. set_base_url ( constructed_base_url. clone ( ) ) ;
395
396
if let Some ( output_dir) = output_dir {
396
397
if !force && output_dir. exists ( ) {
@@ -427,6 +428,7 @@ pub fn serve(
427
428
config_file : & Path ,
428
429
open : bool ,
429
430
include_drafts : bool ,
431
+ store_html : bool ,
430
432
fast_rebuild : bool ,
431
433
no_port_append : bool ,
432
434
utc_offset : UtcOffset ,
@@ -442,6 +444,7 @@ pub fn serve(
442
444
base_url,
443
445
config_file,
444
446
include_drafts,
447
+ store_html,
445
448
no_port_append,
446
449
None ,
447
450
) ?;
@@ -672,6 +675,7 @@ pub fn serve(
672
675
base_url,
673
676
config_file,
674
677
include_drafts,
678
+ store_html,
675
679
no_port_append,
676
680
ws_port,
677
681
) {
@@ -916,6 +920,7 @@ mod tests {
916
920
base_url. as_deref ( ) ,
917
921
& config_file,
918
922
include_drafts,
923
+ false ,
919
924
no_port_append,
920
925
ws_port,
921
926
)
0 commit comments