Eleventy (11ty) contact form

Formgong team ·

An Eleventy contact form is the same job people search as an 11ty contact form. Eleventy writes static HTML and does not run a server for visitors. Post the template to Formgong. You get email and Telegram without a plugin or a function.

Eleventy
<form action="https://formgong.com/submit" method="POST">
  <input type="hidden" name="access_key" value="fk_your_access_key">
  <input type="hidden" name="_lang" value="en">
  <label>Name <input type="text" name="name" autocomplete="name" placeholder="Your name" required></label>
  <label>Email <input type="email" name="email" autocomplete="email" placeholder="you@example.com" required></label>
  <label>Message <textarea name="message" placeholder="How can we help?" required></textarea></label>
  <div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
  <label>Leave this field empty<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
  
  <button type="submit">Send</button>
</form>

How forms work in Eleventy

Eleventy (11ty) compiles templates to static files. Nunjucks, Liquid, HTML and Markdown all work. The getting-started page, checked on 6 October 2026, says v3.1.6 needs Node 18 or newer.

The default output folder is _site. Run npx @11ty/eleventy to build it. Nothing in that folder can receive a POST. The form has to call an endpoint on the web.

Set it up in Eleventy

  1. Create a form in Formgong and copy the access key.
  2. Add contact.njk with the form. Point it at https://formgong.com/submit and include access_key, _lang and botcheck.
  3. Reuse it with {% include "contact-form.njk" %}. Files in _includes are partials, not pages.
  4. Run npx @11ty/eleventy --serve and open http://localhost:8080/. Send a test, then upload _site or connect the repo to your host.
  5. Keep template braces out of plain text you do not want parsed. Eleventy treats .html as Liquid, so a raw {{ is a tag. A .njk file makes that choice obvious.

Formgong or an Eleventy server?

Add a host function when the submit must run your own code or write to your database.

Use Formgong when you only need the message delivered. The 11ty build stays a folder of HTML.

Questions and answers

Is Eleventy the same as 11ty?

Yes. Eleventy is the project name and 11ty is the short name. Both appear in the docs and in search.

Where do the HTML files go?

Into _site, unless you change the output directory. Deploy that folder. The form posts from the browser after the page loads.

Which template language should I use?

Any. Nunjucks and Liquid are the common ones. The form is HTML either way. Match the include syntax to the file type.

Does 11ty have a built-in form handler?

No. The docs cover templates, data and hosting. They do not ship a form inbox. A form backend, or your own server, has to take the POST.

Start free