<div class="top-blog" style="background-image: url('https://f.hubspotusercontent20.net/hubfs/5974320/Blog/Groupe%20124.png')">
<h1 class="page-center content-wrapper">
Bienvenue sur le blog de Knauf Insulation
</h1>
</div>
{% if not topic %}
<div class="page-center content-wrapper">
{# TOP POST // ARTICLE A LA UNE #}
{% set posts = blog_recent_posts('default', 1) %}
{% for post in posts %}
<div class="bl-top-post">
<div class="bl-top-post-inner">
<div class="bl-top-post-img">
<a href="{{ content.absolute_url }}"><img src="{{ resize_image_url( post.post_list_summary_featured_image,690 ) }}" class="hs-featured-image"></a>
</div>
<div class="bl-top-post-content">
{% if post.topic_list %}
<div class="bl-top-content-cat">
{% for tag in post.tag_list %} {# {% set t = t + 1 %} {% if t == 1 %} #}
<a class="topic-link" href="{{ blog_tag_url(group.id, tag.slug) }}">{{ tag.name }}</a>
{# {% endif %} #} {% endfor %}
<p><date>{{ post.publish_date_localized }}</date></p>
</div>
{% endif %}
<h2><a href="{{post.absolute_url}}">{{ post.name }}</a></h2>
<div class="bl-top-post-description">
{{ post.post_list_content|safe|truncatehtml(200, ' ' ) }}
</div>
<div class="post-description-btn">
<a class="more-btn" href="{{ post.absolute_url }}">Lire l'article </a>
</div>
</div>
</div>
</div>
{% endfor %}
{% endif %}
<div class="blog-section container">
<div class="blog-listing-wrapper cell-wrapper">
<div class="blog-section">
<div class="blog-listing-wrapper cell-wrapper">
<div class="">
{% if topic %}
<div class="topic-title">
<h2>Articles : <span>{{ topic|replace('-',' ') }}</span></h2>
</div>
{% endif %}
{# simple_list_page indicates the "blog/all" page, which is a list of links to every blog post #}
<div class="post-listing">
{% for content in contents %}
<div class="post-item">
<div class="post-inner">
<div class="hs-featured-image-wrapper" style="background: url({{ resize_image_url( content.post_list_summary_featured_image,400 ) }}) no-repeat; background-size:cover; ">
{% for tag in content.tag_list %} {% set t = t + 1 %} {% if t == 1 %}
<a class="topic-link tag-link" href="{{ blog_tag_url(group.id, tag.slug) }}">{{ tag.name }}</a> {% endif %} {% endfor %}
</div>
<div class="post-header">
<div class="date">
<date>{{ content.publish_date_localized }}</date>
</div>
<h2><a href="{{content.absolute_url}}">{{ content.name }}</a></h2>
<p>{{ content.post_summary|striptags|truncate(120, breakword=False, end='...') }}</p>
<div class="post-description-btn">
<a class="more-btn" href="{{ content.absolute_url }}">Lire l'article </a>
</div>
</div>
</div>
</div>
{% if current_page_num > 1 %}
<div class="post-item">
<div class="post-inner">
<div class="hs-featured-image-wrapper" style="background: url({{ resize_image_url( content.post_list_summary_featured_image,400 ) }}) no-repeat; background-size:cover; ">
{% for tag in content.tag_list %} {% set t = t + 1 %} {% if t == 1 %}
<a class="topic-link tag-link" href="{{ blog_tag_url(group.id, tag.slug) }}">{{ tag.name }}</a> {% endif %} {% endfor %}
</div>
<div class="post-header">
<div class="date">
<date>{{ content.publish_date_localized }}</date>
</div>
<h2><a href="{{content.absolute_url}}">{{ content.name }}</a></h2>
<p>{{ content.post_summary|striptags|truncate(120, breakword=False, end='...') }}</p>
<div class="post-description-btn">
<a class="more-btn" href="{{ content.absolute_url }}">Lire l'article </a>
</div>
</div>
</div>
</div>
{% endif %}
{% if simple_list_page %}
{% if loop.first %}
<h2><br></h2>
{% endif %}
<h2 class="post-listing-simple"><a href="{{content.absolute_url}}">{{ content.name }}</a></h2>
{% endif %}
{% endfor %}
</div>
</div>
{% if not simple_list_page %}
<div class="blog-pagination">
{% set page_list = [-2, -1, 0, 1, 2] %}
{% if contents.total_page_count - current_page_num == 1 %}{% set offset = -1 %}
{% elif contents.total_page_count - current_page_num == 0 %}{% set offset = -2 %}
{% elif current_page_num == 2 %}{% set offset = 1 %}
{% elif current_page_num == 1 %}{% set offset = 2 %}
{% else %}{% set offset = 0 %}{% endif %}
{% if last_page_num %}
<a class="prev-link" href="{{ blog_page_link(last_page_num) }}">Précédente</a>
{% endif %}
{% for page in page_list %}
{% set this_page = current_page_num + page + offset %}
{% if this_page > 0 and this_page <= contents.total_page_count %}
<a {% if this_page == current_page_num %}class="active"{% endif %} href="{{ blog_page_link(this_page) }}">{{ this_page }}</a>
{% endif %}
{% endfor %}
{% if next_page_num %}<a class="next-link" href="{{ blog_page_link(current_page_num + 1) }}">Suivante</a>{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
Thanks you ![]()
Hi,
I am in the process of creating a blog, only I don’t understand, the last post is also found in the listing blog. How can O make sure that the first post is only displayed once ?
This is my blog : https://app.hubspot.com/design-previewer/5974320/templates/31421512165
And my code :
