diff --git a/exampleSite/content/home/contact.md b/exampleSite/content/home/contact.md index b5d311cd..d8e684c7 100644 --- a/exampleSite/content/home/contact.md +++ b/exampleSite/content/home/contact.md @@ -13,5 +13,10 @@ weight = 70 # Automatically link email and phone? autolink = true +# Email form provider +# 0: Disable email form +# 1: Netlify (requires that the site is hosted by Netlify) +# 2: formspree.io +email_form = 2 +++ diff --git a/i18n/en.yaml b/i18n/en.yaml index 4e88ee4c..ab0299bc 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -98,6 +98,20 @@ - id: more_talks translation: More Talks +# Contact widget + +- id: contact_name + translation: Name + +- id: contact_email + translation: Email + +- id: contact_message + translation: Message + +- id: contact_send + translation: Send + # Publication/Talk details - id: abstract diff --git a/layouts/partials/widgets/contact.html b/layouts/partials/widgets/contact.html index 070914c3..750f3098 100644 --- a/layouts/partials/widgets/contact.html +++ b/layouts/partials/widgets/contact.html @@ -11,13 +11,41 @@
{{ with $page.Content }}

{{ . | markdownify }}

{{ end }} + {{ if and $.Site.Params.email $page.Params.email_form }} + + {{ $post_action := "" }} + {{ if eq $page.Params.email_form 1 }} + {{ $post_action = "netlify" }} + {{ else }} + {{ $post_action = printf "action=\"https://formspree.io/%s\"" $.Site.Params.email }} + {{end}} + +
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ {{end}} +