HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.19k stars 2.9k forks source link

Formspree phased out legacy forms - The corresponding forms needs to be updated #1940

Closed tvercaut closed 3 years ago

tvercaut commented 3 years ago

Describe the bug

Formspree contact forms do not seem to work anymore for new projects as simple email forms are being deprecated: https://help.formspree.io/hc/en-us/articles/360056076314

To Reproduce

Create a new website and try to set up formspree in contact.md:

email_form: 2

Expected behavior

Formspree should work

Technical details:

Related issues / PR:

1528 #1724

gcushen commented 3 years ago

Thanks for spotting that Formspree are deprecating the current approach!

Let's add support for the new Formspree URL parameter.

tvercaut commented 3 years ago

For the record, the solution in #1528 worked for me. I added their proposed custom layouts/partials/widgets/contact.html in my repository and added formspree_form_id = "XXX" in contact.md.

cvanwynsberghe commented 3 years ago

I found a really simple solution which works with Academic :

tvercaut commented 3 years ago

@cvanwynsberghe Thanks for the tip. I had to add the f though use:

email = "f/yourendpoint"

It looks like this email parameters is not used elsewhere and this solution allows for better future proofing. Locally using the modified layouts/partials/widgets/contact.html in https://github.com/wowchemy/wowchemy-hugo-modules/pull/1528 indeed just broke for me after https://github.com/wowchemy/wowchemy-hugo-modules/commit/b647d7e81a5ac59326fe8e5a1424df6a8bff7146

Maybe the name of the variable should just be updated? Or a comment to clarify this solution?

gcushen commented 3 years ago

Docs

To register for Formspree Form ID: https://formspree.io/

New and refactored Contact widget options (remove the options you don't need):

content:
  # Automatically link email and phone or display as text?
  autolink: true

  # Email form provider
  form:
    provider: netlify
    formspree:
      id:
    netlify:
      # Enable CAPTCHA challenge to reduce spam?
      captcha: false

Example: https://github.com/wowchemy/starter-academic/blob/master/content/home/contact.md

tvercaut commented 3 years ago

Thanks for looking into this @gcushen. Unfortunately, this doesn't directly work for me. The contact.html partial currently using a mix of $st.Params.content and $st.Params.contents (note the plural) whereas the new contact configuration use content.

rodrigoalcarazdelaosa commented 3 years ago

Thanks for looking into this @gcushen. Unfortunately, this doesn't directly work for me. The contact.html partial currently using a mix of $st.Params.content and $st.Params.contents (note the plural) whereas the new contact configuration use content.

I can confirm the new widget doesn't work for me either. Probably all the remaining contents must be changed to content.

gcushen commented 3 years ago

Typo is fixed by https://github.com/wowchemy/wowchemy-hugo-modules/commit/34a48f8670c8ca5867de439f732f98929d53add9