Contact form for Jekyll (GitHub Pages)
GitHub Pages won't run server code, which historically meant no working forms. A FormDock endpoint fixes that: the form is plain HTML, the endpoint is set in _config.yml, and GitHub Pages serves it happily.
_includes/contact-form.html
{% comment %} _config.yml:
form_endpoint: https://formdock.app/f/your-form-key
{% endcomment %}
<form action="{{ site.form_endpoint }}" method="POST">
<input type="text" name="name" placeholder="Name" required>
<input type="email" name="email" placeholder="Email" required>
<textarea name="message" placeholder="Message"></textarea>
<input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
<button type="submit">Send</button>
</form>- Include it in any page or layout with {% include contact-form.html %}.
- Works on github.io domains and custom domains alike — the form posts cross-origin to FormDock, so lock CORS to your domain in form settings.
- GitHub Pages' safe mode restricts plugins but not HTML — nothing here needs a plugin.
Get your endpoint: create a free FormDock account (100 submissions/month), add a form, and swap your-form-key for the real key.