mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 17:56:16 +00:00
20 lines
649 B
Ruby
20 lines
649 B
Ruby
# This file is licensed under the MIT License (MIT) available on
|
|
# http://opensource.org/licenses/MIT.
|
|
|
|
## env.rb takes select environmental variables and makes them available
|
|
## to the site templates. Currently, only variables starting with
|
|
## BITCOINORG_ are exported
|
|
|
|
module Jekyll
|
|
class EnvGenerator < Generator
|
|
def generate(site)
|
|
## If necessary, initialize env hash table
|
|
site.config["env"] = site.config["env"] ? site.config["env"] : {}
|
|
|
|
## Load matching environmental variables in to array
|
|
ENV.keys.grep /^BITCOINORG_/ do |key|
|
|
site.config['env'].merge!({ key => ENV[key] })
|
|
end
|
|
end
|
|
end
|
|
end
|