【问题标题】:Jekyll post 'belongs_to' post/collection objectJekyll post 'belongs_to' post/collection 对象
【发布时间】:2014-09-14 05:41:35
【问题描述】:

在 Jekyll 中,是否可以将帖子与集合中的一个或多个特定帖子或对象相关联?并访问他们的 yaml 数据和内容?

【问题讨论】:

    标签: yaml jekyll liquid


    【解决方案1】:

    在不知道您正在尝试做什么的详细信息的情况下,我只能给您一个一般示例。

    您可以使用"where" filter

    {% assign  related_thing = site.[collection] | where: 'yaml_value', yaml_key %}
    

    然后在related_thing上运行一个for循环

    希望有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-27
      • 1970-01-01
      相关资源
      最近更新 更多