<form> can post directly to your endpoint. This works on GitHub Pages too, because nothing runs on a server.
1. Save your Public Key
Copy the Public Key from the Endpoint form’s General tab and add it to_config.yml:
_config.yml
jekyll serve after changing _config.yml; Jekyll does not reload it automatically.
2. Create the form include
_includes/contact-form.html
redirect field returns visitors to your own thank-you page after a successful submission. It is not saved as an answer.
3. Add the pages
contact.md
thank-you.md
bundle exec jekyll serve, open /contact/, send a test response, and confirm it appears in Submissions.
Good to know
- If your theme does not have a
defaultlayout, use the layout your other pages use. - On a GitHub Pages project site, also set
baseurl: "/your-repo"in_config.ymlso the redirect link points to the right place. - To stay on the page and show your own message, use the JavaScript example in the include.