Connecting your HTML form

Contact form for Jekyll

Jekyll turns your files into a static website. A form can be submitted there, but nothing can receive it. FormPost accepts the input and sends it to you by email.

Before you start: create a form in FormPost

Sign up for FormPost, create a form and enter the domain your site runs on. We then show you your form's address. It replaces https://www.formpost.eu/f/abc123 in the code below – nothing else needs to change.

1. Create the form as an include

Save the form in the _includes folder. It then lives in one place and can be used on any page.

_includes/contact-form.html
<form action="https://www.formpost.eu/f/abc123" method="POST">
  <label for="email">Email</label>
  <input type="email" id="email" name="email" required>

  <label for="message">Message</label>
  <textarea id="message" name="message" required></textarea>

  <input type="text" name="_gotcha" style="display:none;" tabindex="-1" autocomplete="off">

  <button type="submit">Send</button>
</form>

2. Use the include on a page

On your contact page – Markdown or HTML – include the form with a single line.

contact.md
{% include contact-form.html %}

Good to know

  • Kramdown, Jekyll's Markdown processor, passes HTML through. You could write the form straight into the Markdown file; the include pays off as soon as you need it on more than one page.
  • We only accept submissions from the domain you entered. Submissions from the local server (jekyll serve on localhost) are rejected; to try things out, use the test form in your dashboard.
  • The action attribute is a full address. You don't need relative_url or baseurl for it.

What FormPost cannot do today

  • Forms are submitted the classic way, meaning the page changes. Sending in the background via JavaScript is not supported at present.
  • We do not accept file attachments.
  • FormPost does not collect consent from your visitors. The notice in your own privacy policy remains your job – the wording for it is waiting, ready to copy, next to your form.

More guides and comparisons

Create a form and try it

The Free plan covers one form with ten notifications a day and costs nothing, permanently.