2013-10-19 22 views
3

我想创建一个分类页面。jekyll可以使用GET参数吗?

{% for post in site.categories[CATEGORY_NAME] %} 
    <li><a href="{{ post.url }}">{{ post.title }}</a> ({{post.date|date:"%-d %B %Y"}})</li> 
{% endfor %} 

是否可以使用页面参数填写CATEGORY_NAME?然后,我可以有一个文件category.html这可以作为多个类别(即category.html?name=foodcategory.html?name=animals索引页。

我发现处理这几个插件,但它似乎是矫枉过正需要一个插件。

  1. https://github.com/zroger/jekyll-categories
  2. http://blog.nitrous.io/2013/08/30/using-jekyll-plugins-on-github-pages.html

这里是最相关的论坛后,我能找到。

https://groups.google.com/forum/#!topic/jekyll-rb/y-dq-63Uvy4

如果我不能在没有插入的情况下做到这一点,有没有很好的理由?

回答

4

我认为正确的答案是,Jekyll网页必须在提供之前编译为html。如果液体语言需要一个参数,这是不可能的。

相关问题