A simple contact form for Eleventy static sites. Since Eleventy generates plain HTML, FormHandle is a natural fit.
mkdir my-site && cd my-site
npm init -y
npm install @11ty/eleventy
npx formhandle initCopy contact.njk into your site's root (or src/ if configured).
Replace YOUR_HANDLER_ID with your handler ID, or use an Eleventy data file:
// _data/formhandle.js
module.exports = {
handlerId: process.env.FORMHANDLE_ID || 'YOUR_HANDLER_ID'
}Then in the template: action="https://api.formhandle.dev/submit/{{ formhandle.handlerId }}".