From 66ddc84a42c1d23a84461f1d2bd17d7b52f7ab64 Mon Sep 17 00:00:00 2001 From: Florian Thomas Date: Thu, 31 Mar 2016 22:02:06 +0200 Subject: [PATCH] Load ENV via dotenv if available fixes #51 --- lib/jekyll-github-metadata.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/jekyll-github-metadata.rb b/lib/jekyll-github-metadata.rb index 4ca729b..e6810a2 100644 --- a/lib/jekyll-github-metadata.rb +++ b/lib/jekyll-github-metadata.rb @@ -1,4 +1,11 @@ require 'octokit' +if defined?(Jekyll) && Jekyll.respond_to?(:env) && Jekyll.env == 'development' + begin + require 'dotenv' + Dotenv.load + rescue LoadError + end +end module Jekyll unless const_defined? :Errors