mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-06 16:15:51 +00:00
feat(widgets): do not require email if using Netlify contact form
Netlify routes messages from contact form to its admin panel, so no email address is required. By not requiring email in this case, it is not revealed to any spam bots which might try to scrape a website's public Git repository. Close #775
This commit is contained in:
1 parent
31eb870296
commit
ca4fd7159d
1 file changed
+4
-1
@@ -11,12 +11,15 @@
|
||||
<div class="col-12 col-lg-8">
|
||||
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
|
||||
|
||||
{{ if and $.Site.Params.email $page.Params.email_form }}
|
||||
{{ if $page.Params.email_form }}
|
||||
|
||||
{{ $post_action := "" }}
|
||||
{{ if eq $page.Params.email_form 1 }}
|
||||
{{ $post_action = "netlify" }}
|
||||
{{ else }}
|
||||
{{ if not $.Site.Params.email }}
|
||||
{{ errorf "Please set an email address for the contact form using the `email` parameter in `config.toml`. Otherwise, set `email_form = 0` to disable the contact form." }}
|
||||
{{ end }}
|
||||
{{ $post_action = printf "action=\"https://formspree.io/%s\"" $.Site.Params.email }}
|
||||
{{end}}
|
||||
|
||||
|
||||
Reference in new issue
Block a user