为什么jekyll不显示评论?

时间:2020-02-16 19:55:28

标签: jekyll liquid

就像在问题中一样。为什么Jekyll不向您显示我有code from this repository的评论。

_layouts/post.html

{% if site.data.comments[page.slug] %}
{% assign comments = site.data.comments[page.slug] | sort %}
{% for comment in comments %}
{% assign email = comment[1].email %}
{% assign name = comment[1].name %}
{% assign date = comment[1].date %}
{% assign message = comment[1].message %}
{% include comment.html index=forloop.index email=email name=name date=date message=message %}
{% endfor %}
{% else %}
<div class="notice">
<h4>Nikt jeszcze nie skomentował.</h4>
</div>
{% endif %}

然后 _includes/comment.html

<div class="comment">
<div class="meta">
<p class="name">
{% if include.email %}
<img src="https://www.gravatar.com/avatar/{{ include.email }}?d=mm&s=60" alt="{{ include.name | escape }}">
{% else %}
<img src="/blog/lib/img/avatar.jpg" alt="{{ include.name | escape }}">
{% endif %} Od: {{ include.name }} <span class="bullet" aria-hidden="true">&bull;</span> <span title="{{ include.date | date: "%Y-%m-%d %H:%M" }}">{{ include.date | date: "%d-%m-%Y" }}</span></p>
</div>
<p class="message">{{ include.message }}</p>
</div>

页面本身正确显示。但是来自_data/comments/POST-NAME/comment-POST-ID.yml的评论未显示在页面上。我不知道为什么它不起作用。 文件所在的相同存储库:https://github.com/IgorKowalczyk/blog

0 个答案:

没有答案
相关问题