Delimiter doing the opposite

Hi there, sorry if this is not the right category, I am building a blog from scratch and my summary is doing the reverse of what it should be doing: Ignoring the summary before the delimiter and truncating the text that comes after. Thanks in advance.

This is my blog_item.html.twig

{% if truncate %}
    <div class="list-item home-card grower">
        {# CARD image #}
        <div class="header-image-wrapper">
            <a href="{{ page.url }}" class="u-url">
            {% if header_image %}
                {% if header_image_file %}
                    {% set header_image_media = page.media.images[header_image_file] %}
                {% else %}
                    {% set header_image_media = page.media.images|first %}
                {% endif %}
                {{ header_image_media.cropZoom(header_image_width, header_image_height).html|raw }}
            {% endif %}
            </a>
        </div>

        <div class="padded-sides-sm">
            {# TAGS #}
            {% include 'partials/taxonomy.html.twig' %}

            {# DATE (COND) #}
            {% if page.date.tag %}
                <span class="list-blog-date">
                    <time class="dt-published" datetime="{{ page.date|date("c") }}">
                        <span>{{ page.date|date("d") }}</span>
                        <em>{{ page.date|date("M") }}</em>
                    </time>
                </span>
                <br>
            {% endif %}

            {# TITLE CARD #}
            <a href="{{ page.url }}" class="u-url">
                <h2 class="p-name">{{ page.title }}</h2>
                
                {# Truncated content #}
                <div class="p-summary">
                    {{ page.summary|raw }}
                </div>
            </a>
        </div>
    </div>


{#  FULL POST (DISPLAYED WHEN 'truncate' IS FALSE)  #}
{% else %}
    <div class="blog-content">
        {# DATE (COND) #}
        {% if page.date.tag %}
            <span class="list-blog-date">
                <time class="dt-published" datetime="{{ page.date|date("c") }}">
                    <span>{{ page.date|date("d") }}</span>
                    <em>{{ page.date|date("M") }}</em>
                </time>
            </span>
            <br>
        {% endif %}

        <div class="case-study">
            {# CASE STUDIES #}
            {% include 'partials/prevnext.html.twig' %}
            {% include 'partials/taxonomy.html.twig' %}
            <div id="text-wrapper">
                <section id="caption-section">
                    <h3>{% for category in page.taxonomy.category %}{{ category }}{% endfor %}</h3>
                    <h1>{{ page.header.title|e }}</h1>
                </section>
                {{ page.content|raw }}
            </div>
            {% include 'partials/prevnext.html.twig' %}
        </div>
    </div>
{% endif %}

@lonko, A kind request to be kind to the reader’s time and effort.

TLDR:

  • Only present a relevant code snippet that replicates the issue.
  • Show what the markdown of the page looks like.
  • Show what is being displayed in the page.
  • And update your post accordingly.

Long read: The art of asking great questions

Thank you.

I thought of shortening the code sample but I thought it might need more context, like people could rightly think I botcheded the Ifs and elses (which I am known to do). Also added comments.

The markdown page is pretty straighforward:

This text is a summary and should be displayed on the homepage, but isn't.

===

This text is the beginning of the post, shouldn't be displayed on the homepage, but it is, then truncated.

Thank you

Still not enough info. Where does truncate come from?

If it’s doing the opposite of what’s expected, did you try replacing {% if truncate %} with {% if not truncate %}?