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

only_prod doesn't work as expected #14

Open
mavaddat opened this issue Oct 27, 2021 · 3 comments
Open

only_prod doesn't work as expected #14

mavaddat opened this issue Oct 27, 2021 · 3 comments

Comments

@mavaddat
Copy link
Owner

From jekyll-cloudinary created by gamue: nhoizey#84

First of all, thanks for the great plugin 👍

When I set only_prod: true the prod-code which gets created doesn't contain the cloudinary tags and uses the local images, which forces me to touch that setting every time I do changes on the page.

For compilation I'm using https://github.com/helaili/jekyll-action

Another minor thing: With only_prod: false the local images aren't getting loaded using 127.0.0.1:4000, which shows up as a link in the console. I need to change it to localhost:4000 that they are shown.

@mavaddat
Copy link
Owner Author

First of all, thanks for the great plugin 👍

Thanks, it's nice having such positive feedback!

When I set only_prod: true the prod-code which gets created doesn't contain the cloudinary tags and uses the local images, which forces me to touch that setting every time I do changes on the page.

For compilation I'm using https://github.com/helaili/jekyll-action

Does it allow you to set JEKYLL_ENV=production before the build command, which is required with only_prod: true?

Another minor thing: With only_prod: false the local images aren't getting loaded using 127.0.0.1:4000, which shows up as a link in the console. I need to change it to localhost:4000 that they are shown.

That's strange, 127.0.0.1 and localhost should be the same, unless you use a local proxy or a specific HTTP server.

@mavaddat
Copy link
Owner Author

That's strange, 127.0.0.1 and localhost should be the same, unless you use a local proxy or a specific HTTP server.

Might be because of I'm using Win10, not that big issue though

Does it allow you to set JEKYLL_ENV=production before the build command, which is required with only_prod: true?

Yes, it actually directly sets it directly at the build call. When checking the code and compare it with other plugins and themes I'm wondering why you are not using jekyll.environment == 'production' for the check.

@mavaddat
Copy link
Owner Author

That's strange, 127.0.0.1 and localhost should be the same, unless you use a local proxy or a specific HTTP server.

Might be because of I'm using Win10, not that big issue though

Ok

Does it allow you to set JEKYLL_ENV=production before the build command, which is required with only_prod: true?

Yes, it actually directly sets it directly at the build call.

Indeed.

When checking the code and compare it with other plugins and themes I'm wondering why you are not using jekyll.environment == 'production' for the check.

Good question.

I guess I mixed the environment variable declaration and the environment check inside the code… 🤔

I have to read https://jekyllrb.com/docs/configuration/environments/ and fix this…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant