If you’re hosting your Jekyll config file on a public repository, you probably don’t want to share API credentials with others. Here is a quick guide that ill teach you how to hide some of your Jekyll configuration.
If you plan on using Jekyll plugins such as Twitter or AlgoliaSearch, you want to avoid publishing your API tokens to the world.
So I did some research and found out that you can actually tell Jekyll to use multiple config files. It became obvious that I could simple create YAML config file that I wouldn’t track in Git. Let’s call this config file
_secret.yml for the sake of this tutorial.
- Open your
- Create a file called
_secret.ymlin your root folder
- Stores all your API tokens in it
- Run this
jekyll s -c _config.yml,_secret.yml
- That’s it! You secret data is safe and won’t be push to your public repository.
Share your strategy to protect your API credentials.