2
中有幾個條件(類別,語言,標籤)的帖子的帖子索引我想在我的Jekyll網站上爲幾個類別和語言提供幾個後索引(索引?),這意味着多於一個條件。在Jekyll
我的帖子有YAML frontmatter包括:
categories:
- research
- blog
lang: en
現在,我想一個帖子指數,因爲,用英語說所有的研究文章。
我可以這樣做:
{% for post in site.posts %}
{% if post.lang == 'en' and post.categories contains 'research' %}
{{ post.title }}
{% endif %}
{% endfor %}
然而,這螺絲了這樣細微的限制和按年份等。限位柱(等)的數量,哲基爾似乎仍然看帖子整個名單,不只是對他們來說,有條件的適用。
事情是這樣的僞代碼將是理想的: {%爲崗位在post.lang == '恩' 和post.categories site.posts包含 '研究' %}
有什麼想法?
詩:我不能使用任何插件;希望它是GH頁面兼容。 PPS:我知道我可以用語言作爲一個類別,但感覺不對 - 這是不同的信息。