> ## Documentation Index
> Fetch the complete documentation index at: https://docs.surveyowl.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Jekyll

> Add an Endpoint form to a Jekyll site, including GitHub Pages.

Jekyll builds static HTML, so a normal `<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`:

```yaml _config.yml theme={null}
url: "https://example.com"
surveyowl_key: "YOUR_FORM_PUBLIC_KEY"
```

Restart `jekyll serve` after changing `_config.yml`; Jekyll does not reload it automatically.

## 2. Create the form include

```html _includes/contact-form.html theme={null}
<form action="https://api.surveyowl.co/v1/submit/{{ site.surveyowl_key }}" method="POST">
  <input type="hidden" name="redirect" value="{{ '/thank-you/' | absolute_url }}" />

  <label for="name">Name</label>
  <input id="name" name="name" required />

  <label for="email">Email</label>
  <input id="email" name="email" type="email" required />

  <label for="message">Message</label>
  <textarea id="message" name="message" required></textarea>

  <button type="submit">Send message</button>
</form>
```

The hidden `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

```markdown contact.md theme={null}
---
layout: default
title: Contact
permalink: /contact/
---

{% include contact-form.html %}
```

```markdown thank-you.md theme={null}
---
layout: default
title: Thank you
permalink: /thank-you/
---

Thanks — your message was sent.
```

Run `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 `default` layout, use the layout your other pages use.
* On a GitHub Pages project site, also set `baseurl: "/your-repo"` in `_config.yml` so the redirect link points to the right place.
* To stay on the page and show your own message, use the [JavaScript example](/developer-api/javascript) in the include.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.