From 1fc6a68ba5857d4ea9afeea99fe5496db698fb1f Mon Sep 17 00:00:00 2001 From: Regis Philibert Date: Fri, 11 Mar 2022 16:05:26 -0500 Subject: [PATCH] huge/Media: Add `imgix.enable` --- layouts/partials/tnd-imgix/private/GetConfig.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/layouts/partials/tnd-imgix/private/GetConfig.html b/layouts/partials/tnd-imgix/private/GetConfig.html index 6b81cb7..551e860 100644 --- a/layouts/partials/tnd-imgix/private/GetConfig.html +++ b/layouts/partials/tnd-imgix/private/GetConfig.html @@ -15,6 +15,15 @@ {{ with partialCached "huge/config/Get" "media" "media" }} {{ with .imgix }} {{ $config = . }} + {{/* To acommodate a per-environment enabling of imgix (imgix will only get images once deployed in production) + We prepopulate the imgix module's own `disable` setting with the opposite of Huge's own `enable` settings. + */}} + {{ with $config.enable }} + {{ if not (partialCached "huge/env/When" . .) }} + {{ $config = merge $config (dict "disable" true) }} + {{ end }} + {{ end }} {{ end }} + {{ end }} {{ return $config }} \ No newline at end of file