Hexo Installation
Step 1 — Create new form endpoint on Getform
All that's required is a name for your form. You specify a name, and Getform will provide a unique form endpoint to identify your Hexo form.
Step 2 — Prepare your Hexo form for your website
You can use the boilerplate code provided on Getform to create your HTML form. It is a basic contact form with email address, name and message fields:
<form accept-charset="UTF-8" action="https://getform.io/f/{unique-endpoint-generated-on-step-1}" method="POST">
<input type="email" name="email" placeholder="Your Email">
<input type="text" name="name" placeholder="Your Name">
<input type="text" name="message" placeholder="Your Message">
<button type="submit">Send</button>
</form>
Step 3 — Create a new blank Hexo site
Run the following commands to create a simple Hexo website:
$ npm install -g hexo-cli
$ hexo init hexo-personal-site
$ cd hexo-personal-site
$ npm install
$ hexo server
Once you finished running the commands above, you can access your Hexo site on http://localhost:4000.
Step 4 - Add a Contact Section to your Hexo site
Create a new directory called contact under your source/_posts directory. Then, create a new markdown file called index.md inside of it, change its content with the following code block:
---
title: Contact Us
date: 2020-11-27 17:30:49
---
<form accept-charset="UTF-8" action="https://getform.io/{unique-endpoint-generated-on-step-1}" method="POST">
<input type="email" name="email" placeholder="Your Email">
<input type="text" name="name" placeholder="Your Name">
<input type="text" name="message" placeholder="Your Message">
<button type="submit">Send</button>
</form>
Important: Don't forget to change the action attribute to a form endpoint URL with yours.Step 5 - Run your Hexo site locally to finalize setup
Run the following command to see your Hexo form in action at localhost:4000/contact/:
hexo server
That's it! Your Hexo site is now running Getform.