Skip to content

Instantly share code, notes, and snippets.

@ganesshkumar
Created January 18, 2017 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ganesshkumar/17aac22ed4a755fcae89e38a5b642e90 to your computer and use it in GitHub Desktop.
Save ganesshkumar/17aac22ed4a755fcae89e38a5b642e90 to your computer and use it in GitHub Desktop.
Jekyll plugin to load environmental variables
module Jekyll
class EnvironmentVariablesGenerator < Generator
def generate(site)
site.config['title'] = ENV['TITLE']
site.config['description'] = ENV['DESCRIPTION']
site.config['twitter'] = ENV['TWITTER_USERNAME']
site.config['github'] = ENV['GITHUB_USERNAME']
site.config['linkedin'] = ENV['LINKEDIN_PUBLIC_ID']
site.config['google_analytics'] = ENV['GOOGLE_ANALYTICS']
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment