我有一个节点网络,其中一些是相互关联的。我使用Jekyll为网站提供支持,并希望使用液体标签来映射这些关系。使用液体标签链接节点
所以,我一直在试图做到这一点的方式如下。
甲,这在类别,是关系到乙 乙,这在类别,是关系到甲,和Ç
当我访问A的页面时,我想看到B被列为相关的。
我已经定义了YAML前面的问题这样:
title: A
category: 1
tags:
- B.html
title: B
category: 2
tags:
- A.html
- C.html
我液态模板的样子:
<h2>{{ page.title }} <span class="label important">{{ page.category }}</span></h2>
<p>Last edited: {{ post.date | date_to_string }}</p>
<p><em>{{ content }}</em></p>
<h4>Related</h4>
<ul>
{% for post in site.tag.{{ post.url }} %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
对我来说,这看起来像它应该工作。事实上,事实并非如此。
欢迎提出建议!
此外,相关Github的页面在这里: https://raw.github.com/salmonhabitat/salmonhabitat.github.com/master/_posts/2011-12-12-bycatch.md
https://raw.github.com/salmonhabitat/salmonhabitat.github.com/master/_posts/2011-12-12-accidental.md
https://github.com/salmonhabitat/salmonhabitat.github.com/blob/master/_layouts/post.html
我正打算要发生是为 '意外伤害' 下 '海洋误捕的' 露面相关节点...
从jekyll文档中,您可以使用'{%post_url 2010-07-21-name-of-post%}' – bluesmoon 2012-06-06 01:38:51