在 Jekyll 中输出多个段落标签

Multiple Paragraph Tags Being Outputted in Jekyll

我不知道为什么,但出于某种原因,我的页面上输出了多个空段落标记。我的模板如下所示:

<article class="post-item sm-col sm-col-12 md-col md-col-5 {{ thecycle }}">
  <header>
    <h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
  </header>
  <p>{{ post.excerpt }}<p>
  <footer>
    <p class="date"><time pubdate datetime="{{ post.date }}">{{ post.date | date: "%B %-d, %Y" }}</time></p>
  </footer>
</article>

但是我的静态 HTML 看起来像这样:

那些多余的段落标签是从哪里来的?

感谢您对此提供的任何帮助。提前致谢!

这是因为 post.excerpt 已经包裹在 p 标签中。

如果你想输出没有p标签的摘录,你可以{{ post.excerpt | remove: '<p>' | remove: '</p>' }}.

See Jekyll documentation.