From 06847f35a19834ff26c60b691522107fa201a7a5 Mon Sep 17 00:00:00 2001
From: Lorenzo Balzani <balzanilo@gmail.com>
Date: Mon, 13 Jun 2022 18:31:55 +0000
Subject: [PATCH] feat: Add reCAPTCHA to the contact form (#365)

---
 i18n/it.toml                            |    2 +-
 exampleSite/config/_default/params.toml |    1 +
 layouts/partials/contact.html           |    3 +++
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml
index 3f7d450..1d70721 100644
--- a/exampleSite/config/_default/params.toml
+++ b/exampleSite/config/_default/params.toml
@@ -15,6 +15,7 @@
 doNotLoadAnimations = false
 # Form Spree Contact Form
 #contactFormAction = "https://formspree.io/f/your-form-hash-here"
+#contactFormReCaptcha = "your-site-key-here"
 # Google Fonts
 #googleFonts = ["Indie+Flower", "Roboto:ital,wght@0,100;0,400;0,700;1,400"]
 # Google Site Verify
diff --git a/i18n/it.toml b/i18n/it.toml
index 4a7ca0c..bef0bc9 100644
--- a/i18n/it.toml
+++ b/i18n/it.toml
@@ -42,4 +42,4 @@
 other = "Informazioni"
 
 [update]
-other = "Aggiorna"
\ No newline at end of file
+other = "Aggiorna"
diff --git a/layouts/partials/contact.html b/layouts/partials/contact.html
index 6589869..3293ace 100644
--- a/layouts/partials/contact.html
+++ b/layouts/partials/contact.html
@@ -15,6 +15,9 @@
         <textarea class="field-style" name="message" id="message" rows="6" placeholder="{{ i18n "message" }}"></textarea>
       </li>
       <li>
+        <div class="g-recaptcha" data-sitekey="{{ .Site.Params.contactFormReCaptcha }}"></div>
+      </li>
+      <li>
         <input class="field-style" type="submit" value="{{ i18n "send" }}" />
       </li>
       <li>

--
Gitblit v1.10.0