【发布时间】:2020-01-23 14:27:55
【问题描述】:
所以我有一个具有以下基本结构的网站:
<body>
<section>
<p>Text of Section 1</p>
</section>
<section>
<p>Text of Section 2</p>
</section>
...
</body>
我想使用 jekyll 从 markdown 文件生成整个网站,但由于 markdown 不知道任何类似部分的内容,我的想法是使用 markdown 作为普通文本,然后从另一个文件中包含缺少的 html,如下所示:
---
layout: default.html
---
Text of Section 1.
{% include sectionbreak.html %}
Text of Section 2.
为此,sectionbreak.html 必须包含类似
</section>
<section>
但是,jekyll 似乎会在包含文件的开头自动转义任何关闭的 html 标记,结果是一个更像这样的网站,彼此堆叠越来越多的部分:
<body>
<section>
<p>Text of Section 1</p>
<p></section></p>
<section>
<p>Text of Section 2</p>
...
</body>
有没有人知道如何禁用这种行为,或者做什么来生成网站?
【问题讨论】:
标签: html include escaping jekyll