20 lines
667 B
Ruby
20 lines
667 B
Ruby
# Plugin to add environment variables to the `site` object in Liquid templates
|
|
|
|
module Jekyll
|
|
|
|
class EnvironmentVariablesGenerator < Generator
|
|
|
|
def generate(site)
|
|
site.config['domain'] = ENV['DOMAIN'] || 'badssl.com'
|
|
site.config['prod'] = ENV['DOMAIN'] == ENV['PROD_DOMAIN']
|
|
site.config['http-domain'] = ENV['HTTP_DOMAIN'] || 'http.badssl.com'
|
|
site.config['serving-path'] = ENV['SERVING_PATH'] || '/var/www/badssl/_site'
|
|
|
|
site.config['cert-path'] = site.config['serving-path'] + '/certs/sets/current/gen/chain'
|
|
site.config['dhparam-path'] = site.config['serving-path'] + '/certs/sets/current/gen/dhparam'
|
|
end
|
|
|
|
end
|
|
|
|
end
|