Replace "hidden" check in Liquid with where_exp
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
{% assign entries = site[include.collection] %}
|
||||
{% assign entries = site[include.collection] | where_exp: "post", "post.hidden != true" %}
|
||||
|
||||
{% if include.sort_by %}
|
||||
{% assign entries = entries | sort: include.sort_by %}
|
||||
@ -9,7 +9,5 @@
|
||||
{% endif %}
|
||||
|
||||
{%- for post in entries -%}
|
||||
{%- unless post.hidden -%}
|
||||
{% include archive-single.html %}
|
||||
{%- endunless -%}
|
||||
{% include archive-single.html %}
|
||||
{%- endfor -%}
|
||||
|
@ -1,14 +1,10 @@
|
||||
{% assign posts = include.posts | where_exp: "post", "post.hidden != true" %}
|
||||
<div class="page__related">
|
||||
{% include before-related.html %}
|
||||
<h2 class="page__related-title">{{ site.data.ui-text[site.locale].related_label | default: "You May Also Enjoy" }}</h2>
|
||||
<div class="grid__wrapper">
|
||||
{% assign count = 0 %}
|
||||
{% assign limit = include.limit | default: 4 %}
|
||||
{% for post in include.posts %}
|
||||
{% if post.hidden %}{% continue %}{% endif %}
|
||||
{% for post in posts limit:4 %}
|
||||
{% if post.id == page.id %}{% continue %}{% endif %}
|
||||
{% if count >= limit %}{% break %}{% endif %}
|
||||
{% assign count = count | plus: 1 %}
|
||||
{% include archive-single.html type="grid" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
@ -1,5 +1,4 @@
|
||||
{%- for post in site.categories[include.taxonomy] -%}
|
||||
{%- unless post.hidden -%}
|
||||
{% include archive-single.html %}
|
||||
{%- endunless -%}
|
||||
{% assign posts = site.categories[include.taxonomy] | where_exp: "post", "post.hidden != true" %}
|
||||
{%- for post in posts -%}
|
||||
{% include archive-single.html %}
|
||||
{%- endfor -%}
|
||||
|
@ -1,5 +1,4 @@
|
||||
{%- for post in site.tags[include.taxonomy] -%}
|
||||
{%- unless post.hidden -%}
|
||||
{% include archive-single.html %}
|
||||
{%- endunless -%}
|
||||
{% assign posts = site.tags[include.taxonomy] | where_exp: "post", "post.hidden != true" %}
|
||||
{%- for post in posts -%}
|
||||
{% include archive-single.html %}
|
||||
{%- endfor -%}
|
||||
|
Reference in New Issue
Block a user