Contact form for Eleventy (11ty)
Eleventy generates plain HTML, which is exactly what FormDock wants. Drop the form into any template (Nunjucks, Liquid, WebC) and point it at your endpoint.
contact.njk
--- layout: base.njk title: Contact --- <form action="https://formdock.app/f/your-form-key" 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>
- Store the endpoint in _data/site.json and reference it as {{ site.formEndpoint }} to keep it in one place across forms.
- Pair with a /thanks/ page in your site and set it as the form's redirect URL.
Get your endpoint: create a free FormDock account (100 submissions/month), add a form, and swap your-form-key for the real key.