将 FormSpree 集成到 GitHub Jekyll markdown 文件中

Integrating FormSpree into GitHub Jekyll markdown file

我正在尝试向 GitHub Jekyll 网站添加联系表单。我大部分时间都在听从最受欢迎的答案 here, from a YouTube tutorial here, and from the FormSpree site.

的建议

为了保持网站设计的一致性,与这些教程相比的一个主要区别可能是我将 FormSpree 联系表单添加到降价文件中,即 here。正如您在这个降价文件中看到的,我尝试创建表单两次(一次是简单的建议,一次是更多的花哨的东西)。

我几乎可以肯定表格没有按预期显示(在我关注的 YouTube 教程中看起来更像 this),因为我没有使用 .html 文件。但是,当我尝试将我的页面转换为 .html 而不是 .md 时,它呈现的联系表单页面看起来 visually/aesthetically 与其余网页选项卡不一致。因此,我希望使用相同的当前 YAML 元数据来维护 .md 格式。

我的问题是:是否可以直接在 Markdown (.md) 文件中将 FormSpree 联系表单添加到 GitHub Jekyll 页面,如果可以,我需要做哪些更改才能完成此操作?感谢您分享任何建议!

在 md 文件中使用 html 块似乎很棘手。

在您的特定情况下,因为您包含原始 html,您可以使用 nomarkdown extension 标签。

试试吧:

{::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}