Skip to content

Commit

Permalink
Escape path for live reload. Fix #1247. (#1266)
Browse files Browse the repository at this point in the history
zola serve's live reload feature used to fail on Windows due to the path
separator (`\`) to not being escaped.
  • Loading branch information
Aidiakapi committed Dec 23, 2020
1 parent 657905e commit 358446a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ctrlc = "3"
open = "1.2"
globset = "0.4"
relative-path = "1"
serde_json = "1.0"

site = { path = "components/site" }
errors = { path = "components/errors" }
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ fn rebuild_done_handling(broadcaster: &Sender, res: Result<()>, reload_path: &st
r#"
{{
"command": "reload",
"path": "{}",
"path": {},
"originalPath": "",
"liveCSS": true,
"liveImg": true,
"protocol": ["http://livereload.com/protocols/official-7"]
}}"#,
reload_path
serde_json::to_string(&reload_path).unwrap()
))
.unwrap();
}
Expand Down

0 comments on commit 358446a

Please sign in to comment.