From 92df633146e3f3c2931cecf3d3be2a01abc85af8 Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Thu, 8 Feb 2024 19:05:16 +0800 Subject: [PATCH] fix: allow removing default configurations by setting to empty string (#148) --- layouts/partials/decap-cms/functions/config.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/partials/decap-cms/functions/config.html b/layouts/partials/decap-cms/functions/config.html index 1dcdede..27ab8d5 100644 --- a/layouts/partials/decap-cms/functions/config.html +++ b/layouts/partials/decap-cms/functions/config.html @@ -8,7 +8,12 @@ {{- range $keys -}} {{- $key := . -}} {{- if isset $params $key -}} - {{- $config.Set $key (index $params $key) -}} + {{- $val := index $params $key }} + {{/* Ignore empty value. */}} + {{- if eq $val "" }} + {{- continue }} + {{- end }} + {{- $config.Set $key $val -}} {{- end -}} {{- end -}} {{- $definitions := partial "decap-cms/functions/definitions" (default dict (index $params "_configs")) }}