-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Let liveReload script infer the port #8023
Labels
Milestone
Comments
You are right. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hugo always forces a port when loading the liveReload javascript file if the feature is enabled
There's also the chance of manually setting the port with the flag
liveReloadPort
, but this means that we need to know the port beforehand and it's not always possible.For example, with randomly assigned ports when running Hugo in docker, since the port is assigned when starting the container, this means that we cannot set
liveReloadPort
and the live reload JS will be invoked withport=1313
and thus fail.Example:
When loading the page the request to load the script includes the port
But the container is not listening to it, and the feature fails
Solution
There's no need to enforce a port always, if it's not passed the script will use the current host and port in the URL
This solves the issue by allowing users to specify if the port should not be passed by setting
liveReloadPort
to0
.The text was updated successfully, but these errors were encountered: