diff --git a/Gemfile b/Gemfile index f2785ab2..8aa42f66 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ group :jekyll_plugins do gem 'jekyll-scholar' gem 'jekyll-archives' gem "jekyll-resize", git: "https://github.com/UCSD-E4E/jekyll-resize" + gem "jekyll-environment-variables" end # Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem diff --git a/Gemfile.lock b/Gemfile.lock index 3764501c..4f5287ff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -69,6 +69,8 @@ GEM webrick (~> 1.7) jekyll-archives (2.2.1) jekyll (>= 3.6, < 5.0) + jekyll-environment-variables (1.0.1) + jekyll (>= 3.0, < 5.x) jekyll-feed (0.17.0) jekyll (>= 3.7, < 5.0) jekyll-redirect-from (0.16.0) @@ -138,6 +140,7 @@ DEPENDENCIES http_parser.rb (~> 0.6.0) jekyll (~> 4.3.4) jekyll-archives + jekyll-environment-variables jekyll-feed (~> 0.12) jekyll-redirect-from jekyll-resize! diff --git a/_config.yml b/_config.yml index 5c96e08c..9f330e2b 100644 --- a/_config.yml +++ b/_config.yml @@ -38,6 +38,7 @@ plugins: - jekyll-feed - jekyll-seo-tag - jekyll-redirect-from + - jekyll-environment-variables whitelist: - jekyll-redirect-from diff --git a/_includes/google-analytics.html b/_includes/google-analytics.html index e9afb209..772b5892 100644 --- a/_includes/google-analytics.html +++ b/_includes/google-analytics.html @@ -1,12 +1,9 @@ + + - diff --git a/_includes/head.html b/_includes/head.html index 58e3d193..e0c56fd8 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -34,7 +34,7 @@ {%- feed_meta -%} - {%- if jekyll.environment == 'production' and site.google_analytics -%} + {%- if jekyll.environment == 'production' and site.env.google_analytics -%} {%- include google-analytics.html -%} {%- endif -%}