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
formsubmit_endpoint: https://formsubmit.app/f/YOUR_FORM_ID2. Include
<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
---
layout: page
title: Contact
permalink: /contact/
---
{% include contact-form.html %}Create thanks.md with permalink: /thanks/ for the redirect.
Tips
- Set
urlin_config.ymlsoabsolute_urlproduces 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.