Closed rhempel closed 7 years ago
If you set JEKYLL_ENV=production
it should get around this new behavior. jekyll serve
now automatically sets site.url
to http://localhost:4000
when in development
, which is the default environment.
https://jekyllrb.com/docs/configuration/#specifying-a-jekyll-environment-at-build-time
If you want to avoid this in 3.3 you'll want to run Jekyll like this
JEKYLL_ENV=production bundle exec jekyll serve
But it's not "production" - I'm running this on a vagrant machine precisely for the purpose of testing. I'll test to see if it fixes the problem though and move on.
I get that your Vagrant machine isn't technically a production env. Unfortunately setting the production
flag with Jekyll is the only way to get around it auto assigning url
in 3.3.0. At least as far as I know.
By the way this behavior is not documented in https://jekyllrb.com/docs/variables/
@white-gecko It's documented, just not in a place anyone is likely to look for it. http://jekyllrb.com/news/#3-siteurl-is-set-by-the-development-server
Had a hell of a time this morning when I opened a new project based on hpstr-jekyll-theme after doing a
bundle-update
- the server url was overwriting the site url which was definitely NOT happening with Jekyll 3.2.1A bit of background - I have successfully developed an internal site using this theme as it stood on September 15 and serve the site from a Vagrant instance like so:
And I leave
url:
blank in my_config.yml
file. When the user requests (for example) theindex.html
file the URLs should look like this:And indeed this was the case for the existing site that was built with Jekyll 3.2.1 which was current when I built the site.
Fast forward to this morning and I branched my site to mess about with the theme colours (I wanted to invert the colour scheme to be dark instead of light) - the latest version of Jekyll is now 3.3.0 and the exact same
_config.yml
and Jekyll serve command line pushes out urls that look like this:Yeah - that's not going to work at all :-)
So I'm downgrading to Jekyll 3.2.1 but anyone that clones hpstr is going to run into this with Jekyll 3.3.0 so heads up!