Cannot set site.url to a different address than the --host flag address in development #5743
Comments
It will not be set if you set |
Is there any chance that this could be configurable for non-production environments? I'd like to not have to use |
You can define |
I see, thanks, that workaround works for me. However, I am still a bit wary of using a different environment in the long term, since I don't know what other config values, if any, get set manually by Jekyll in the |
Another workaround is to override default url in a separate config file: |
@richardxia If you're using a VM, I'd highly recommend setting up a separate webserver (nginx is very easy to install and setup) and using We could whitelist |
Thanks for the suggestion, @parkr. That solution seems straightforward enough for me to use. Since this is just a development VM, I think I'll use |
@richardxia, @parkr I simple run: |
github-pages
My Reproduction Steps
When running
jekyll serve --host 0.0.0.0
, thesite.url
variable gets set to http://0.0.0.0:4000 when used in templates.The Output I Wanted
I'd like to be able to set a site URL that is different from the network interface that the Jekyll server is listening to. I am doing development in a VM, so the hostname that I want my browser to see is different from the IP address/network interface that the Jekyll server is bound to. For example, since my VM has a host-only network interface at 192.168.33.10, I'd like to set http://192.168.33.10:4000 as the site URL that Jekyll renders so that any absolute URL still works, while still instructing Jekyll to listen on the 0.0.0.0 interface.
I understand that I can set
--host 192.168.33.10
, but one additional complication is that I am actually running Jekyll inside of a Docker container inside a VM. The Docker container won't allow any child processes to bind to 192.168.33.10./cc @jekyll/build
The text was updated successfully, but these errors were encountered: