我有一個節點網絡,其中一些是相互關聯的。我使用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