Skip to content
FormSubmit

Jekyll

How to add a contact form to Jekyll

Add a contact form to a Jekyll site (including GitHub Pages) with an include file and a form backend.

1 min readUpdated Sep 28, 2026

Jekyll can't process form submissions itself, so point your form at a FormSubmit endpoint. Put the form in an include, keep the endpoint in _config.yml, and you have a working contact form on any static host — including GitHub Pages.

1. Config

_config.yml
formsubmit_endpoint: https://formsubmit.app/f/YOUR_FORM_ID

2. Include

_includes/contact-form.html
<form action="{{ site.formsubmit_endpoint }}" method="POST">
  <label>Name <input type="text" name="name" required></label>
  <label>Email <input type="email" name="email" required></label>
  <label>Message <textarea name="message" rows="5" required></textarea></label>
  <input type="hidden" name="_redirect" value="{{ '/thanks/' | absolute_url }}">
  <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Send</button>
</form>

3. Page

contact.md
---
layout: page
title: Contact
permalink: /contact/
---

{% include contact-form.html %}

Create thanks.md with permalink: /thanks/ for the redirect.

Tips

  • Set url in _config.yml so absolute_url produces your real domain.
  • Add your domain to the allowlist.
  • Build a nicer-looking form in the form generator and paste its HTML into the include.

Frequently asked questions

Will this work on GitHub Pages?

Yes. GitHub Pages builds Jekyll into static HTML and the form posts directly to FormSubmit.

Keep reading

Your form backend is 60 seconds away

Sign in with Google, create a form, paste the endpoint. Free forever for small sites — no credit card.