2012-08-17 16 views
8

Sono nuovo utilizzando Jekyll e Jekyll-Bootstrap.Filtraggio dei messaggi utilizzando le categorie in Jekyll-Bootstrap

Ho trovato questo per il filtraggio per categoria:

<ul class="posts"> 
{% for post in site.posts %} 
    {% if post.categories contains 'demography' %} 
     <li><span>{{ post.date | date_to_string }}</span> &raquo; <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li> 
    {% endif %} 
{% endfor %} 
</ul> 

Quando cerco di combinare i tags e categorie non funziona:

<ul class="posts"> 
{% for post in site.posts %} 
    {% if post.categories contains 'demography' and post.tags contains 'R' %} %} 
     <li><span>{{ post.date | date_to_string }}</span> &raquo; <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li> 
    {% endif %} 
{% endfor %} 
</ul> 

Qualche idea?

Grazie in anticipo!

+0

In modo semplicistico, è possibile utilizzare 2 se le istruzioni sono annidate l'una nell'altra. – huon

risposta

4

Hai un %} troppo in linea # 3.

Oltre a ciò, dovrebbe funzionare correttamente.

Problemi correlati