【发布时间】:2019-09-12 16:01:50
【问题描述】:
我正在尝试创建一个相关的帖子部分。我以前使用循环和条件来实现这一点,但我想要一种更有效、更简洁的方法。我使用包含变量来获得类似的结果,但无论出于何种原因,如果我尝试使用帖子的前端问题,我会得到一个空结果。示例:
---
categories:
- Featured
---
{% assign featured-posts = site.posts | where: "categories", page.categories %}
【问题讨论】: