diff --git a/_config.yml b/_config.yml index 5a65c37a56d..5be45ad609e 100644 --- a/_config.yml +++ b/_config.yml @@ -2,7 +2,7 @@ # # This config file is meant for settings that affect your whole blog, values # which you are expected to set up once and rarely edit after that. -# This file is *NOT* reloaded automatically when you use 'bundle exec jekyll serve'. +# This file is *NOT* reloaded automatically when you use 'bundle exec jekyll serve'. # If you change this file, please restart the server process. # Site settings @@ -16,7 +16,7 @@ theme: jekyll-agency url : "" # the base hostname & protocol for your site, e.g. http://example.com baseurl: "" # the subpath of your site, e.g. /blog -title : Your Awesome Website +title : Your Awesome Website email : your-email@example.com #this is also the email contact forms will go to description: "Site description" author : Your Name @@ -30,4 +30,8 @@ analytics: collections: portfolio: -markdown: kramdown \ No newline at end of file +markdown: kramdown + +# Uncomment following line to use Formspree form ID based URL instead of email based URL +# Details: https://help.formspree.io/hc/en-us/articles/360017735154-How-to-prevent-spam +# formspree_form_path: "f/a_form_id" \ No newline at end of file diff --git a/_includes/contact.html b/_includes/contact.html index 40ef6e72e6a..49c78ade948 100644 --- a/_includes/contact.html +++ b/_includes/contact.html @@ -9,8 +9,8 @@

{{ site.data.sitetext.contact.text | d
-
- + +
diff --git a/assets/js/contact_me.js b/assets/js/contact_me.js index 30bfc247f32..50262358f88 100644 --- a/assets/js/contact_me.js +++ b/assets/js/contact_me.js @@ -10,7 +10,7 @@ $(function() { submitSuccess: function($form, event) { event.preventDefault(); // prevent default submit behaviour // get values from FORM - var url = "https://formspree.io/" + "{{ site.email }}"; + var url = "https://formspree.io/" + "{% if site.formspree_form_path %}{{ site.formspree_form_path }}{% else %}{{ site.email }}{% endif %}"; var name = $("input#name").val(); var email = $("input#email").val(); var phone = $("input#phone").val(); @@ -25,7 +25,7 @@ $(function() { $.ajax({ url: url, type: "POST", - dataType: "json", + dataType: "json", data: { name: name, phone: phone, @@ -33,7 +33,7 @@ $(function() { message: message }, cache: false, - + success: function() { // Success message $('#success').html("
"); @@ -46,7 +46,7 @@ $(function() { //clear all fields $('#contactForm').trigger("reset"); }, - + error: function() { // Fail message $('#success').html("
"); @@ -57,7 +57,7 @@ $(function() { //clear all fields $('#contactForm').trigger("reset"); }, - + complete: function() { setTimeout(function() { $this.prop("disabled", false); // Re-enable submit button when AJAX call is complete