-
Notifications
You must be signed in to change notification settings - Fork 945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escape path for live reload. Fix #1247. #1266
Conversation
src/cmd/serve.rs
Outdated
"originalPath": "", | ||
"liveCSS": true, | ||
"liveImg": true, | ||
"protocol": ["http://livereload.com/protocols/official-7"] | ||
}}"#, | ||
reload_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can write that one by hand, I don't really understand why this fixes the problem tbh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem isn't the path, the path's fine, the problem is that "D:\Some\Directory\path.html"
is not valid JSON. Because \
like in Rust, is an escape sequence, so it fails to parse. It should become "D:\\Some\\Directory\\path.html"
. I chose serde_json
because it's already in the dependency hierarchy anyways (the templates use it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see! Can you rebase? The tests should pass after that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, didn't see the commit that snuck in there. It's done now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's still something messed up in there. I'll look into it I guess. I'll just hard reset and patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, should be all good now.
zola serve's live reload feature used to fail on Windows due to the path separator (`\`) to not being escaped.
Perfect thanks! |
Sanity check:
Code changes
next
branch?This is a fix for #1247.