Skip to content
FormToMail

Static sites & frameworks

How do I add a contact form to a GitHub Pages or Jekyll site?

By the FormToMail team · Checked against official sources · Updated

GitHub Pages is static hosting: it serves your HTML, CSS and JavaScript and runs no server code, so a form there must post to an external form endpoint. In Jekyll, put the form in an include (for example _includes/contact.html) and add {% include contact.html %} where you want it.

Options on GitHub Pages
OptionWorks on GitHub Pages?
Form endpointYes
PHP mail scriptNo (no PHP)
Netlify FormsNo (Netlify-hosted only)
mailto linkYes, but opens the visitor's mail app

Jekyll include

html
<form action="https://getformtomail.com/f/YOUR_FORM_ID" method="POST">
  <input name="name" required>
  <input name="email" type="email" required>
  <textarea name="message" required></textarea>
  <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Send</button>
</form>

Quick answers

How do I add a contact form to a github pages site?

Use a form endpoint as the action; GitHub Pages can't run server code.

Contact form for jekyll site without backend?

Same: an include with the HTML form and an endpoint URL.

Student portfolio contact form free?

A free endpoint covers it: 250 submissions a month is far more than a portfolio gets.

What to do next

Create a free endpoint for your GitHub Pages form.

Get your form endpoint

Sources

Checked: . Prices, limits and features of other services change: confirm current values at the official links above. Product names belong to their owners; we are not affiliated with them.