From c35cc45ef65cc78c504431921ab6075eb9366365 Mon Sep 17 00:00:00 2001 From: Andreas Hnida Date: Fri, 26 Apr 2024 23:15:16 +0200 Subject: [PATCH] refactor to add captcha dynamically --- themes/hugoplate/layouts/_default/single.html | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/themes/hugoplate/layouts/_default/single.html b/themes/hugoplate/layouts/_default/single.html index d334113..6d626bc 100755 --- a/themes/hugoplate/layouts/_default/single.html +++ b/themes/hugoplate/layouts/_default/single.html @@ -4,20 +4,21 @@ {{ .Content }} {{/* TODO Cleanup */}} +{{ $useCaptcha := site.Params.useCaptcha }} +{{ if $useCaptcha }} +{{ $captchaSystemJS := resources.Get "vendor/captcha-system/js/main.js" | minify }} +{{ $captchaSystemCSS := resources.Get "vendor/captcha-system/css/main.css" | minify }} + + +{{ end }} {{ if eq .Params.bestellformular true }} -{{ $formularjs := resources.Get "js/bestellformular.js" | minify }} -{{/* */}} +{{/* {{ $formularjs := resources.Get "js/bestellformular.js" | js.Build (dict "minify" true) }} */}} +{{ $formularjs := resources.Get "js/bestellformular.js" }} + - {{ else if eq .Params.kontaktformular true }} {{ $formularjs := resources.Get "js/kontaktformular.js" | minify }} -{{/* */}} + -{{/* TODO Captcha rauswerfen, falls wir es nicht mehr brauchen */}} -{{/* {{ $captchaSystemJS := resources.Get "vendor/captcha-system/js/main.js" | minify }} */}} -{{/* {{ $captchaSystemCSS := resources.Get "vendor/captcha-system/css/main.css" | minify }} */}} -{{/* */}} -{{/* */}} - -{{ end }} {{ end }} +{{ end }} \ No newline at end of file