{% extends 'frontend/base.html.twig' %}
{% block metaTitle %}{{ article.metaTitle ?: article.title }}{% endblock %}
{% block metaDescription %}{{ article.metaDescription ?: article.content|block_editor_render|striptags|html_entity_decode|slice(0, 200) }}...{% endblock %}
{% block metaTags %}
<meta property="og:image" content="{{ app.request.schemeAndHttpHost }}{{ article.cover.publicUrl }}" />
<meta property="og:image:secure_url" content="{{ app.request.schemeAndHttpHost }}{{ article.cover.publicUrl }}" />
<meta property="og:type" content="website"/>
<meta property="og:title" content="{{ article.metaTitle ?: article.title }}">
<meta property="og:description" content="{{ article.metaDescription ?: article.content|block_editor_render|striptags|html_entity_decode|slice(0, 200) }}...">
<meta property="og:url" content="{{ app.request.schemeAndHttpHost }}{{ app.request.pathInfo }}">
<meta name="twitter:title" content="{{ article.metaTitle ?: article.title }}">
<meta name="twitter:description" content="{{ article.metaDescription ?: article.content|block_editor_render|striptags|html_entity_decode|slice(0, 200) }}...">
<meta name="twitter:image" content="{{ app.request.schemeAndHttpHost }}{{ article.cover.publicUrl }}">
<meta name="twitter:card" content="summary_large_image">
{% endblock %}
{% block body %}
<section class="space-1 border-top">
<div class="container">
<div>
<a href="{{ path('frontend_blog') }}" class="fw-bold link text-primary link-animation" aria-label="{% trans %}Torna indietro{% endtrans %}">{% trans %}Torna indietro{% endtrans %}</a>
</div>
<h1 class="font-weight-bold mt-3">{{ article.title }}</h1>
</div>
</section>
<section class="min-vh-25 min-vh-lg-65 bg-img-center overlay-35 d-flex justify-content-center align-items-center" style="background-image: url('{{ article.cover.publicUrl }}')"></section>
{% if article.content %}
<section class="space-top-2 space-bottom-3 article-content">
<div class="container">
<div class="row">
<div class="col-lg-8">
{{ article.content|block_editor_render }}
</div>
<div class="col-lg-4">
<div class="sticky-top" style="top: 180px">
<div class="bg-light p-lg-4 p-3 rounded mb-4">
<h5 class="mb-3 fw-bold">{% trans %}Condividi con{% endtrans %}</h5>
<div class="d-flex w-100 justify-content-between">
<div>
<a href="https://facebook.com/sharer/sharer.php?u={{ app.request.schemeAndHttpHost }}{{ app.request.pathInfo }}" target="_blank">
<img src="{{ asset('images/blog/share/facebook.svg') }}" class="img-fluid" alt="share">
</a>
</div>
<div>
<a href="https://t.me/share/url?url={{ app.request.schemeAndHttpHost }}{{ app.request.pathInfo }}&text=Dai un'occhiata a questo articolo sul sito Astralpool!" target="_blank">
<img src="{{ asset('images/blog/share/telegram.svg') }}" class="img-fluid" alt="share">
</a>
</div>
<div>
<a href="https://twitter.com/share?url={{ app.request.schemeAndHttpHost }}{{ app.request.pathInfo }}" target="_blank">
<img src="{{ asset('images/blog/share/twitter.svg') }}" class="img-fluid" alt="share">
</a>
</div>
<div>
<a href="whatsapp://send?text=Dai un'occhiata a questo articolo sul sito Astralpool! {{ app.request.schemeAndHttpHost }}{{ app.request.pathInfo }}" target="_blank">
<img src="{{ asset('images/blog/share/whatsapp.svg') }}" class="img-fluid" alt="share">
</a>
</div>
<div>
<a href="mailto:?subject=Dai un'occhiata a questo articolo sul sito Astralpool!&body=Leggi questo articolo {{ app.request.schemeAndHttpHost }}{{ app.request.pathInfo }}" target="_blank">
<img src="{{ asset('images/blog/share/mail.svg') }}" class="img-fluid" alt="share">
</a>
</div>
</div>
</div>
{% if latest_articles(article) is not empty %}
<div class="bg-light p-lg-4 p-3 rounded">
<h5 class="mb-3 fw-bold">{% trans %}Ultimi articoli{% endtrans %}</h5>
{% for latestArticle in latest_articles(article) %}
<div class="d-flex align-items-center mb-3">
<figure class="media equal-4-3 w-100 me-4" style="max-width: 80px">
<span style="background-image: url('{{ latestArticle.cover.publicUrl }}')"></span>
</figure>
<div>
<a href="{{ path('frontend_blog_article_read', {slug: latestArticle.slug}) }}" class="fw-bold mb-2">{{ latestArticle.title }}</a>
<p class="fs-sm text-muted">il {{ latestArticle.date|date('d/m/Y') }}</p>
</div>
</div>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
</section>
{% endif %}
<section>
<div class="container">
<div class="row gx-1 space-bottom-1 space-bottom-lg-2">
<div class="col-12 space-bottom-1">
<h4 class="font-weight-bold">{% trans %}Potrebbe interessarti anche{% endtrans %}</h4>
</div>
{% for relatedArticle in related_articles(article) %}
<div class="col-lg-4 mb-3">
<div class="h-100 d-flex flex-column">
<a href="{{ path('frontend_blog_article_read', {slug: relatedArticle.slug}) }}" class="small-section" aria-label="{{ relatedArticle.title }}">
<figure class="media equal-4-3">
<span style="background-image: url('{{ relatedArticle.cover.publicUrl }}')"></span>
</figure>
<div class="abs-text">
<span class="h3">{{ relatedArticle.title }}</span>
</div>
</a>
<div class="bg-primary pt-4 px-4 position-relative flex-grow-1">
<div class="abs-primary-overlay"></div>
<p class="text-white mb-0">
{{ relatedArticle.getContent()|block_editor_render|striptags|html_entity_decode|slice(0, 200) }}
</p>
</div>
<a href="{{ path('frontend_blog_article_read', {slug: relatedArticle.slug}) }}" aria-label="{% trans %}Leggi tutto{% endtrans %}" class="btn btn-secondary w-100 text-start fw-bold text-uppercase">
{% trans %}Leggi tutto{% endtrans %} <i data-feather="chevron-right" style="width: 20px"></i>
</a>
</div>
</div>
{% endfor %}
</div>
</div>
</section>
{% endblock %}
{% block javascripts %}
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Article",
"name": "{{ article.title }}",
"author": {
"@type": "Person",
"name": "Astralpool"
},
"articleBody": "{{ article.content|block_editor_render|html_entity_decode|striptags|e('js') }}",
{% if article.categories is not empty %}
"articleSection": "{{ article.categories.first.name }}",
{% endif %}
"wordCount": "{{ article.content|block_editor_render|html_entity_decode|striptags|word_count }}"
%}
</script>
{% endblock %}