【发布时间】:2020-12-02 05:21:19
【问题描述】:
我正在为我的 Jekyll 网站创建一个作者页面。在这个页面上,我想显示这个特定作者写的所有帖子。
这就是我的帖子的样子:
title: "Some title"
authors: [author1, author2]
为了保存作者列表,我使用集合。
作者长这样:
short: author1
name: "Author 1 Full Name"
现在author1我想找到这个作者的所有文章。我正在尝试为此使用where_exp:
{% assign articles = site.posts | where_exp: "authors", "authors contains page.short" %}
在这种情况下,page.short 包含 author1。
但是列表articles 是空的。你知道可能是什么问题吗?
【问题讨论】: