Welcome to mirror list, hosted at ThFree Co, Russian Federation.

contact-form.html « shortcodes « layouts - gitlab.com/rmaguiar/hugo-theme-color-your-world.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8dd44016682f9cf12c3ed0acc34f193482819e1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{{ $autoComplete := "off" }}

{{ if or .Page.Params.Contact.autoComplete .Site.Params.Contact.autoComplete }}
  {{ $autoComplete = "on" }}
{{ end }}


<form id="contact" action="https://formspree.io/{{ or .Page.Params.Contact.formspreeFormId .Site.Params.Contact.formspreeFormId }}" method="post" accept-charset="utf-8">
  <label>{{ T "name" }}
    <input aria-label="{{ T "name" }}" type="text" name="name" minlength="3" {{ with or .Page.Params.Contact.Placeholder.name .Site.Params.Contact.Placeholder.name }}placeholder="{{ . }}"{{ end }} autocomplete="{{ $autoComplete }}" required>
  </label>
  
  <label>Email<input aria-label="Email" type="email" name="_replyto" {{ with or .Page.Params.Contact.Placeholder.email .Site.Params.Contact.Placeholder.email }}placeholder="{{ . }}"{{ end }} autocomplete="{{ $autoComplete }}" required></label>
  
  {{ with or .Page.Params.Contact.subject .Site.Params.Contact.subject }}
    {{ if gt (len .) 1 }}
      <label>{{ T "subject" }}
        <select aria-label="{{ T "subject" }}" name="_subject">
    
          {{ range . }}
            <option>{{ . }}</option>
          {{ end }}
        
        </select>
      </label>
    {{ else }}
      <input type="hidden" name="_subject" value="{{ index . 0 }}" />
    {{ end }}
  {{ else }}
  
    {{ with or .Page.Params.Contact.Placeholder.subject .Site.Params.Contact.Placeholder.subject }}
      <label>{{ T "subject" }}
        <input aria-label="{{ T "subject" }}" type="text" name="_subject" minlength="6" placeholder="{{ . }}" autocomplete="{{ $autoComplete }}" required>
      </label>
    {{ end }}
  
  {{ end }}
  
  
  <label>{{ T "message" }}<textarea id="message" aria-label="{{ T "message" }}" rows="6" name="message" {{ with or .Page.Params.Contact.messageMinLength .Site.Params.Contact.messageMinLength | default 140 }}minlength="{{ . }}"{{ end }} {{ with or .Page.Params.Contact.Placeholder.message .Site.Params.Contact.Placeholder.message }}placeholder="{{ . }}"{{ end }} required></textarea></label>
  
  <input type="text" name="_gotcha" style="display:none">
  
  <input type="submit" value="{{ T "submit" }}">

</form>