为什么当navbox.next_article
是字符串'2018-01-05-man-command'时,以下代码不会产生输出?!
{% capture np %} {{ site.posts | where:"post","navbox.next_article contains post.title" }} {% endcapture %}
The next post is {{ np.title }}
我的帖子2018-01-05-man-command.md
有一个YAML前面的事情:
---
layout : post
title : 'Man Command'
tags : [RHCSA, RHCSA_mod, Using Essential Tools, Man Command]
categories: [RHCSA]
navbox:
# prev_article:
next_article: 2018-01-05-understanding-globbing-and-wildcards
---
_includes/post.html
文件可通过以下方式访问:
{% unless include.excerpt %}
{{ post.content }}
{% include navbox.html navbox=page.navbox %}
{% endunless %}
_layout/post.html
使用它来设置帖子的布局:
{% include post.html post=page link_title=false %}
我的navbox.html
包含:
{% assign navbox = include.navbox %}
{% capture np %} {{ site.posts | where:"post","navbox.next_article contains post.title" }} {% endcapture %}
The next post is {{ np.title }}
但是,当我运行bundle exec jekyll serve
时,我得到的只有:
下一篇文章是
为什么那条线不起作用?我是jekyll的新手所以我有可能在某个地方犯了一个大多数直觉的错误。请告诉我我能解决的问题。