Hide similar content in preview

This commit is contained in:
Jake Howard 2023-06-03 15:27:17 +01:00
parent e8cd4f6628
commit e0f3ab3311
Signed by: jake
GPG Key ID: 57AFB45680EDD477
1 changed files with 12 additions and 10 deletions

View File

@ -5,15 +5,17 @@
{% block post_content %}
{{ block.super }}
{% cache FRAGMENT_CACHE_TTL|jitter:FRAGMENT_CACHE_TTL_JITTER "similar-content" page.id request.is_preview %}
<section class="container similar-content" id="similar-content">
<h2 class="subtitle is-size-2">Similar content</h2>
{% if not request.is_preview %}
{% cache FRAGMENT_CACHE_TTL|jitter:FRAGMENT_CACHE_TTL_JITTER "similar-content" page.id request.is_preview %}
<section class="container similar-content" id="similar-content">
<h2 class="subtitle is-size-2">Similar content</h2>
{% for page in page.get_similar_posts %}
{% block listing_item %}
{% include "common/listing-item.html" %}
{% endblock %}
{% endfor %}
</section>
{% endcache %}
{% for page in page.get_similar_posts %}
{% block listing_item %}
{% include "common/listing-item.html" %}
{% endblock %}
{% endfor %}
</section>
{% endcache %}
{% endif %}
{% endblock %}