Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 603 Bytes

File metadata and controls

25 lines (18 loc) · 603 Bytes

Eleventy (11ty)

A simple contact form for Eleventy static sites. Since Eleventy generates plain HTML, FormHandle is a natural fit.

Setup

mkdir my-site && cd my-site
npm init -y
npm install @11ty/eleventy
npx formhandle init

Copy 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 }}".