有没有办法使用 Jekyll 从 Markdown 文件中包含 HTML 部分?
例子:
文件index.md
:
---
layout: default
title: Home
---
This is a [Markdown](http://daringfireball.net/projects/markdown/) file.
{% include foobar.html %}
文件_includes/foobar.html
:
<ul>
<li>Foo</li>
<li>Bar</li>
</ul>
不幸的是,这似乎不适用于我的情况。
为了完整性,这里是我的 _config.yml
文件的全部内容:
encoding: utf-8
markdown: kramdown
baseurl:
最佳答案
html 显示为纯文本的一个常见原因是 html 片段缩进至少四个空格。
这会导致 jekyll 将 html 解释为将按字面显示的代码块。
(我知道评论中已经提到了这一点,但我花了一段时间才发现并理解我遇到了完全相同的问题)
关于html - Jekyll:在 Markdown 文件中包含 HTML 部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28030858/