Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

ENV_ variables usage #21

Closed
martzoukos opened this issue Sep 20, 2016 · 5 comments
Closed

ENV_ variables usage #21

martzoukos opened this issue Sep 20, 2016 · 5 comments
Assignees
Labels

Comments

@martzoukos
Copy link

martzoukos commented Sep 20, 2016

Hello,

thanks for the great work in this tool.
I have a question regarding PR #19, tried to set it up for a project of mine and I have this config set up: https://gist.github.com/martzoukos/1faece5f70e56ee57954d4116fce9bb4
and this .env file on my project's root folder: https://gist.github.com/martzoukos/1659a797ad15ff59d22bdb4f79f15be3

  • When I'm running jekyll contentful I get a jekyll 3.2.1 | Error: Contentful::Unauthorized error.
  • If I replace the ENV_CONTENTFUL_SPACE_ID and ENV_CONTENTFUL_ACCESS_TOKEN in the config with their values, then the fetch works.
  • I have gem 'dotenv-rails' in my gemfile

Is there something I'm missing in this setup?

Thank you in advance for your help.

@dlitvakb
Copy link
Contributor

Hey @martzoukos,

dotenv will only work if you use a Rake command (like explained on the Caveats section of the Readme), this is because of how Jekyll itself works with external gems, so sadly that's not something I can help with.

To use it without dotenv, just add to your .bashrc or .bash_profile the following 2 lines:

export CONTENTFUL_ACCESS_TOKEN=abc123
export CONTENTFUL_SPACE_ID=abc123

Else, you can specify them when running the command like follows:

CONTENTFUL_ACCESS_TOKEN=abc123 CONTENTFUL_SPACE_ID=abc123 jekyll contentful

Sorry that Jekyll is so opinionated with some stuff

Hope that helps

Cheers

@dlitvakb dlitvakb self-assigned this Sep 20, 2016
@martzoukos
Copy link
Author

Hello @dlitvakb

and thanks a lot for the quick reply! :)

That also works so I'll try that.

Thank you.

@jcbpl
Copy link

jcbpl commented Sep 20, 2016

Any plans to cut a new gem release that would include #19?

@dlitvakb
Copy link
Contributor

Hey @jcbpl,

Yes, this will be released on Monday after I return from my vacations

Cheers

@jcbpl
Copy link

jcbpl commented Sep 20, 2016

@dlitvakb Awesome, thank you!

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

No branches or pull requests

3 participants