Skip to content
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

site.config['url'] should be respected regardless of environment #5488

Closed
3 of 17 tasks
miklb opened this issue Oct 17, 2016 · 10 comments
Closed
3 of 17 tasks

site.config['url'] should be respected regardless of environment #5488

miklb opened this issue Oct 17, 2016 · 10 comments

Comments

@miklb
Copy link
Contributor

miklb commented Oct 17, 2016

  • I believe this to be a bug, not a question about using Jekyll.
  • I updated to the latest Jekyll (or) if on GitHub Pages to the latest github-pages
  • I read the CONTRIBUTION file at https://jekyllrb.com/docs/contributing/
  • This is a feature request.

  • I am on (or have tested on) _macOS_ 10+
  • I am on (or have tested on) _Debian/Ubuntu_ GNU/Linux
  • I am on (or have tested on) _Fedora_ GNU/Linux
  • I am on (or have tested on) _Arch_ GNU/Linux
  • I am on (or have tested on) _Other_ GNU/Linux
  • I am on (or have tested on) _Windows_ 10+

  • I was trying to install.
  • There is a broken Plugin API.
  • I had an error on GitHub Pages, and I have reproduced it locally.
  • I had an error on GitHub Pages, and GitHub Support said it was a Jekyll Bug.
  • I had an error on GitHub Pages and I did not test it locally.
  • I was trying to build.
  • It was another bug.

My Reproduction Steps

I am using a plugin that stores all links in a post in a .cache file under source, the url of the post containing them for further processing. Specifically, the plugin uses site.config['url'] & the permalink. In 3.3, this breaks, writing http://localhost:4000 instead of the value in config.

The Output I Wanted

Respect the value of the config file.

@Crunch09
Copy link
Member

Hi, have you tried to set your JEKYLL_ENV to a different value?

@DirtyF DirtyF added the pending-feedback We are waiting for more info. label Oct 17, 2016
@miklb
Copy link
Contributor Author

miklb commented Oct 17, 2016

bundle exec jekyll serve JEKYLL_ENV=production dd not work. My point is, there should be a way to read the explicitly set value in config regardless of the environment.

@jekyllbot jekyllbot removed the pending-feedback We are waiting for more info. label Oct 17, 2016
@miklb
Copy link
Contributor Author

miklb commented Oct 17, 2016

To be clear, I never had any issue serving my site locally with that value set prior to 3.3 release.

@pathawks
Copy link
Member

JEKYLL_ENV=production bundle exec jekyll serve

Can you explain your issue a bit more? I'm not sure I understand.

@miklb
Copy link
Contributor Author

miklb commented Oct 17, 2016

My issue is that I don't understand why you can't read the explicitly set value of config and it not be hijacked, regardless of environment. While never had a problem with site.url being set to my domain in my config and serving locally, I sorta understand the change. But I don't understand why there isn't a way to get the raw value. Hijacking user set config values seems like a very slippery slope and I would love to see the discussion on the decision to do so.

To clarify, the plugin will always want the domain url for that cache file.

@Crunch09
Copy link
Member

You are still able to set a local url via the host and port options (and if you want ssl stuff). As described here those values are for local server hostname and local server port.
A config like this:

host: jekyll.local
port: 4444
url: https://example.com

Would give you http://jekyll.local:4444 in your development environment and https://example.com in any other environment for site.url.

@miklb
Copy link
Contributor Author

miklb commented Oct 17, 2016

So to be clear, serving locally, the only way to read the url config setting is to set a JEKYLL_ENV to something other than development? I personally find that a horrible solution.

@pathawks
Copy link
Member

Ok, I was more trying to understand your workflow to see if there were a better way to go about things.

I guess the bottom line is that Jekyll is working as intended, and this is not a bug.

@suprafly
Copy link

I agree with @miklb - this is really unintuitive. I spent a good deal of time debugging this behaviour as well. I would expect the variable to return the data that is contained there, not to coerce it into something that it believes is more accurate.

@DirtyF
Copy link
Member

DirtyF commented Dec 11, 2017

Jekyll lives by the 80% rule, default behavior is documented here:
https://jekyllrb.com/docs/usage/#override-default-development-settings

@jekyll jekyll locked and limited conversation to collaborators Dec 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants