mirror of
https://github.com/zyllian/webdog.git
synced 2025-05-11 02:56:38 -07:00
introduce webdog cli tool
This commit is contained in:
parent
8b7620b0bd
commit
399a0c1b87
26 changed files with 528 additions and 108 deletions
|
@ -19,7 +19,7 @@ use warp::{
|
|||
};
|
||||
|
||||
use crate::{
|
||||
resource::RESOURCES_PATH, Site, SiteBuilder, PAGES_PATH, ROOT_PATH, SASS_PATH, TEMPLATES_PATH,
|
||||
Site, SiteBuilder, SiteConfig, PAGES_PATH, RESOURCES_PATH, ROOT_PATH, SASS_PATH, TEMPLATES_PATH,
|
||||
};
|
||||
|
||||
/// Helper to get the "name" of a path.
|
||||
|
@ -94,7 +94,7 @@ fn create(
|
|||
builder.site.build_all_pages(builder)?;
|
||||
builder.build_all_resources()?;
|
||||
}
|
||||
} else if relative_path.display().to_string() == "config.yaml" {
|
||||
} else if relative_path.display().to_string() == SiteConfig::FILENAME {
|
||||
let new_config = serde_yml::from_str(&std::fs::read_to_string(path)?)?;
|
||||
builder.site.config = new_config;
|
||||
builder.reload()?;
|
||||
|
@ -277,8 +277,9 @@ impl Site {
|
|||
.expect("Failed to decode URL");
|
||||
|
||||
if p == "_dev.js" {
|
||||
let res =
|
||||
Response::new(include_str!("./js/refresh_websocket.js").into());
|
||||
let res = Response::new(
|
||||
include_str!("./embedded/js/refresh_websocket.js").into(),
|
||||
);
|
||||
return Ok(res);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue