https://github.com/ibug/jekyll-environment-variables
Use environment variables in Jekyll site
https://github.com/ibug/jekyll-environment-variables
Last synced: over 1 year ago
JSON representation
Use environment variables in Jekyll site
- Host: GitHub
- URL: https://github.com/ibug/jekyll-environment-variables
- Owner: iBug
- Created: 2018-05-09T15:27:46.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-08-12T07:27:02.000Z (almost 6 years ago)
- Last Synced: 2025-03-18T07:11:47.458Z (over 1 year ago)
- Language: Ruby
- Homepage: https://rubygems.org/gems/jekyll-environment-variables
- Size: 2.93 KB
- Stars: 21
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jekyll Environment Variables
[](https://travis-ci.org/iBug/jekyll-environment-variables) [](https://badge.fury.io/rb/jekyll-environment-variables)
## Installation
Install the gem:
```
gem install jekyll-environment-variables
```
And then add it to your `_config.yml`:
```yaml
plugins: # "gems" before Jekyll 3.5
- jekyll-environment-variables
```
Alternatively, you can use Bundler with `Gemfile`:
```ruby
group :jekyll_plugins do
gem 'jekyll-environment-variables'
end
```
Then run `bundle install` and let Bundler handle it for you.
## Usage
All environment variables will be copied to `site.env` for use in Liquid templates.
```html
Hostname: {{ site.env.HOSTNAME }}
My home: {{ site.env.HOME }}
```