If you want to create your own contact form with, say PHP for example, you can do it. Just remember these two things:
Jekyll will copy anything not preceded with an underscore or ignored verbatim to the _site directory.
You can include an HTML file into a PHP file.
I am using a PHP library on my server to deliver mail from an HTML contact form created by Jekyll. My issue, though, is the lack of server-side validation or notification to the user of a un/successfull delivery or what fields did not validate. I'd rather not have a custom Success.html and Fail.html page for responses.
This is how I got around it.
My Jekyll structure looks like this:
/..
_config.yml
_layouts/
default.html
default-php.html
_includes/
header.html
footer.html
contact-form.html
nav.html
...
about/
index.md => index.html
services/
index.md => index.html
contact/
contact.md => contact.html
index.php (includes contact.html)
My contact-form.html
include and default-php.html
layout both contain PHP snippets to print variables.
When someone browses to www.mysite.com/contact
it will load index.php
which contains my full HTML page with snippets of PHP code to print variables.
At the top of that PHP file you can process $_POST
or $_GET
data from your contact form or returned from your mail delivery script and print messages to the sender or even add classes to the form fields to indicate they failed validation.
One drawback is that This will not load in Jekyll's local server (localhost:4000).
Maybe with some jiggering you can get it. I'm not sure. I simply setup a vhost to point mysite.local
to /web/root/myjekyllsite/_sites
and it works fine.