Make contact form configurable

This commit is contained in:
Clara Wildpaner
2021-04-04 16:00:22 +02:00
parent 8f4fb16b4b
commit 9206c784bf
2 changed files with 27 additions and 10 deletions

View File

@@ -40,6 +40,22 @@ summarylength = 25
# We're using formspree.io for form handling, paste your formspree url below
formspreeFormUrl = "https://formspree.io/myykjpje"
# Contact Form
[params.contactForm]
placeholder_first_name = "First Name"
placeholder_last_name = "Last Name"
placeholder_email = "Email"
placeholder_project_type = "Project Type"
placeholder_about_the_project = "About the Project"
send_message = "Send Message"
[[params.contactForm.projectType]]
value = "gd"
title = "Graphics Design"
[[params.contactForm.projectType]]
value = "wd"
title = "Web Design"
# Navbar Action Button
[params.navAction]
status = true

View File

@@ -13,31 +13,32 @@
<form id="contact-form" action="{{ .Site.Params.formspreeFormUrl }}" method="POST">
<div class="row">
<div class="col-lg-6">
<input type="text" class="form-control" name="first-name" id="first-name" placeholder="First Name">
<input type="text" class="form-control" name="first-name" id="first-name" placeholder="{{ .Site.Params.contactForm.placeholder_first_name }}">
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="last-name" id="last-name" placeholder="Last Name">
<input type="text" class="form-control" name="last-name" id="last-name" placeholder="{{ .Site.Params.contactForm.placeholder_last_name }}">
</div>
<div class="col-lg-6">
<input type="email" class="form-control" name="email" id="email" placeholder="Email">
<input type="email" class="form-control" name="email" id="email" placeholder="{{ .Site.Params.contactForm.placeholder_email }}">
</div>
<div class="col-lg-6">
<div class="select-wrapper">
<select class="form-control" id="projectType" name="project-type">
<option value="" selected disabled hidden>Project Type</option>
<option value="gd">Graphics Design</option>
<option value="wb">Web Design</option>
<option value="" selected disabled hidden>{{ .Site.Params.contactForm.placeholder_project_type }}</option>
{{ range .Site.Params.contactForm.projectType }}
<option value="{{ .value }}">{{ .title }}</option>
{{ end }}
</select>
</div>
</div>
<div class="col-12">
<textarea class="form-control" id="aboutProject" name="about-project" rows="6" placeholder="About the Project"></textarea>
<textarea class="form-control" id="aboutProject" name="about-project" rows="6" placeholder="{{ .Site.Params.contactForm.placeholder_about_the_project }}"></textarea>
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary" id="contact-form-button">
<span class="btn-area">
<span data-text="Send Message">
Send Message
<span data-text="{{ .Site.Params.contactForm.send_message }}">
{{ .Site.Params.contactForm.send_message }}
</span>
</span>
</button>