我无法在Jekyll if else语句中使用post.content
我有一个博客。在主页上,我列出了10篇博客文章,并做了简要说明。分页由我无法在Jekyll if else语句中使用post.content,jekyll,liquid,blogs,Jekyll,Liquid,Blogs,我有一个博客。在主页上,我列出了10篇博客文章,并做了简要说明。分页由jekyll-paginate-v2提供。从Wordpress导入后,描述有三个可能的位置,每个位置按顺序处理 {% for post in paginator.posts %} <article> {% if post.description %} {{ post.description }}.. {% elsif post.meta._yoast
jekyll-paginate-v2
提供。从Wordpress导入后,描述有三个可能的位置,每个位置按顺序处理
{% for post in paginator.posts %}
<article>
{% if post.description %}
{{ post.description }}..
{% elsif post.meta._yoast_wpseo_metadesc %}
{{ post.meta._yoast_wpseo_metadesc }}..
{% else %}
{{ post.content | markdownify | strip_html | truncatewords: 50 }}..
{% endif %}<a href="{{ post.url }}" title="{{ post.title }}">Read More »</a>
</article>
{% endfor %}
如果我用post.extract
替换post.content
,我也不会得到任何内容
你知道为什么吗?你确定在paginator.posts中有帖子吗?如果语句看起来没问题,我会尝试使用site.posts,这样做很好。另外,请尝试检查if语句之外的
post.content
。谢谢。成功了。你确定你在paginator.posts中有帖子吗?如果语句看起来没问题,我会尝试使用site.posts,这样做很好。另外,请尝试检查if语句之外的post.content
。谢谢。成功了。
{{ post.content | markdownify | strip_html | truncatewords: 50 }}..