hugo-toha / toha

A Hugo theme for personal portfolio
https://hugo-toha.github.io
MIT License
1.04k stars 600 forks source link

Add Contact Form functionality #29

Closed daveops1 closed 10 months ago

daveops1 commented 4 years ago

It would be nice to have the option to include a contact form, allowing the form action to be whatever forms provider the user chooses like Netlify, Typeform, etc...

hossainemruz commented 4 years ago

Can you please point me to some example for contact form? I have no idea on how they works.

daveops1 commented 4 years ago

Sure! I'm actually working on a custom section now using your theme's basic framework. I can share when I'm finished. Essentially since Hugo generates a static site, need to have a <form action=#> pointing to an API that handles contact form submissions. Here are some links below that show this idea:

Nirzak commented 3 years ago

How about an in-built Netlify form to use. But the only drawback will be one must have to use Netlify. This is the major drawback of Hugo, actually. As it's a static site generator, we have to use dynamic servers to handle requests on the static Hugo for many features.

hossainemruz commented 3 years ago

Since, the theme now support specifying template for a section, we can definitely have Netlify form as a Contact form template.

Nirzak commented 3 years ago

Since, the theme now support specifying template for a section, we can definitely have Netlify form as a Contact form template.

Yup netlify has an official documentation for forms. https://docs.netlify.com/forms/setup/ and this post from hugo community can be helpful for the implementation https://discourse.gohugo.io/t/is-it-possible-to-add-a-contact-form-to-a-site/1550/2 I have found a sample code from victor hugo's hugo-cms-template git here https://github.com/netlify-templates/one-click-hugo-cms/blob/master/site/layouts/partials/contact-form.html

hossainemruz commented 3 years ago

Ok. I will try to design the form layout whenever get some time.

hossainemruz commented 10 months ago

You can add your own contact form following this guideline. https://toha-guides.netlify.app/posts/customizing/new-section/