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

Instructions in Usage result in a error #3

Closed
Barsonax opened this issue Nov 9, 2018 · 15 comments
Closed

Instructions in Usage result in a error #3

Barsonax opened this issue Nov 9, 2018 · 15 comments

Comments

@Barsonax
Copy link

Barsonax commented Nov 9, 2018

When working through Usage I noticed that the following command does not work:

PS C:\Users\RickvanDam\source\repos\Barsonax\Barsonax.github.io> JEKYLL_ENV=production bundle exec jekyll build
JEKYLL_ENV=production : The term 'JEKYLL_ENV=production' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:1
+ JEKYLL_ENV=production bundle exec jekyll build
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (JEKYLL_ENV=production:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Iam running this on windows.

@philnash
Copy link
Owner

Ah, apologies, I wrote the instructions and ran them on my Mac only. I guess this is not how Windows machines set environment variables.

I don't think you can set an environment variable inline like this on Windows. You could look into setting the JEKYLL_ENV variable using the set command and then run bundle exec jekyll build after.

If you are able to get through this, I'd really appreciate a pull request that updates the Usage section with your experiences so that this gem can better support Windows developers too.

@Barsonax
Copy link
Author

Already tried that but it seems jekyll is not fooled by that :)

@philnash
Copy link
Owner

Do any of the windows instructions in this blog post help?

@Barsonax
Copy link
Author

Barsonax commented Nov 13, 2018

Tried it:
image

But when I run bundle exec jekyll build I don't see any gzip files.

@philnash
Copy link
Owner

Where are you looking for the gzipped files?

@Barsonax
Copy link
Author

In the _site folder. I only see html, css etc files there.

@philnash
Copy link
Owner

philnash commented Nov 13, 2018

Have you added jekyll-gzip to the plugins array in your _config.yml?

(I didn’t think this was necessary, but maybe it is and I’ll need to update the instructions.)

@Barsonax
Copy link
Author

No I haven't done that yet. I only added it to the gemfile like the instructions said.

@philnash
Copy link
Owner

Ah, give that a go and let me know if it helps. Then I’ll update the Readme.

@philnash
Copy link
Owner

Was this the solution? Would love to get it into the README if that's what I was missing.

@Barsonax
Copy link
Author

Haven't had the time yet to check.

@philnash
Copy link
Owner

Ok, let me know when you do! Thanks!

@Barsonax
Copy link
Author

Barsonax commented Nov 15, 2018

I still don't see any gzip's

EDIT: argh forgot to hit the save in vs code. Now I do see the gzip files
image

Is it normal the normal assets are still there?

@Barsonax
Copy link
Author

Barsonax commented Nov 15, 2018

To summarize:

  1. Add jekyll-gzip to your plugins node in _config.yml
  2. Add gem 'jekyll-gzip' to your Gemfile
  3. Run bundle install
  4. Create a new JEKYLL_ENV environment variable and set the value to production
  5. Close VS code and reopen it (so that it picks up the new variable)
  6. Run bundle exec jekyll build
  7. You will see gzip files in the _site folder

@philnash
Copy link
Owner

Hooray!

It is normal that the regular assets remain, if a user agent requests the asset but doesn't say that it will accept gzip as an encoding we want to be able to serve the original asset.

I will try to write up the extra instructions around environment variables for Windows. I have already added the bit about adding to the plugins section in _config.yml.

Thanks for working through this with me!

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

No branches or pull requests

2 participants