Search code examples
githubjekyllcontact-formgithub-flavored-markdown

Integrating FormSpree into GitHub Jekyll markdown file


I am attempting to add a contact form to a GitHub Jekyll website. I have mostly been following advice from the most-liked answer here, from a YouTube tutorial here, and from the FormSpree site.

In my attempt to keep the website design consistent, one major difference compared to these tutorials is probably that I am adding the FormSpree contact form to a markdown file, which is here. As you can see in this markdown file, I tried creating the form twice (once with bare-bone suggestions and once with more bells and whistles).

I am almost certain the form is not looking as expected (which in the YouTube tutorial I was following would look more like this) because I am not using a .html file. However, when I tried to convert my page to .html instead of .md it rendered the contact form page looking visually/aesthetically inconsistent with the rest of the webpage tabs. As a result, I am hoping to maintain the .md format with the same current YAML metadata.

My question is: Is it possible to add a FormSpree contact form to GitHub Jekyll pages directly inside a Markdown (.md) file and, if so, what alterations would I need to make to accomplish this? Thank you for sharing any advice!


Solution

  • Using html chunks in md files can seem quite tricky.

    In your particular case, as you're including raw html, you can use nomarkdown extension tag.

    Just try :

    {::nomarkdown}
    <form action="http://formspree.io/moqeoggo method="POST">
      <input type="email" name="_replyto">
      <textarea   name="body"></textarea>
      <input type="submit" value="Send">
    </form>
    
    
    {:/nomarkdown}