2021-03-29 13:58:05 +02:00
{% set full = full is defined and full %}
<div class="col-12">
<div class="body">
{% if post .isQuick %}
<div class="quick">
2021-04-21 10:45:33 +02:00
{% set image = null %}
{% if post .quickImage %}
{% set image = post .quickImage %}
{% elseif post .image %}
{% set image = asset ( post .image ) %}
{% endif %}
2021-03-29 13:58:05 +02:00
{% set url = post .quickUrl %}
{% set title = post .title %}
2021-05-29 13:02:12 +02:00
{% set content = post .content | murph_url %}
2021-03-29 13:58:05 +02:00
2022-02-22 11:06:02 +01:00
{% if post .quickVideo and post .quickShowVideo and post .quickVideoHeight and post .quickVideoWidth %}
2021-03-29 13:58:05 +02:00
<div class="quick-video">
<div class="video-ratio" data-ratio=" {{ post .quickVideoHeight * 1 0 0 / post .quickVideoWidth }} %">
<iframe src=" {{ post .quickVideo }} " allowfullscreen></iframe>
</div>
</div>
2021-04-21 10:45:33 +02:00
{% elseif image %}
2021-03-29 13:58:05 +02:00
<div class="quick-image">
<a href=" {{ url }} " target="_blank">
2021-03-30 14:37:10 +02:00
<img src=" {{ asset ( 'build/images/px.png' ) }} " data-src=" {{ image }} " alt=" {{ title }} " title=" {{ title }} ">
2021-03-29 13:58:05 +02:00
</a>
</div>
{% endif %}
<div class="quick-body">
<h2 class="h4 no-margin">
<a href=" {{ url }} " target="_blank">
{{ - title -}}
</a>
</h2>
<p class="no-margin">
<a href=" {{ url }} " target="_blank"> {{ url }} </a>
</p>
{% if post .contentFormat == 'html' %}
2021-07-09 23:42:38 +02:00
{{ - post .content | murph_url | file_attributes | post -}}
2022-03-26 14:31:37 +01:00
{% elseif post .contentFormat == 'markdown' %}
2021-07-09 23:42:38 +02:00
{{ - post .content | murph_url | file_attributes | markdown ( 'post' ) -}}
2022-03-26 14:31:37 +01:00
{% elseif post .contentFormat == 'editorjs' %}
{{ - post .content | murph_url | file_attributes | editorjs_to_html -}}
2021-03-29 13:58:05 +02:00
{% endif %}
{% if not full %}
<p>
2021-11-23 22:48:55 +01:00
<a href=" {{ safe_path ( 'blog_menu_post' , { post : post .id , slug : post .slug , _domain : _domain } ) }} ">
2021-03-29 13:58:05 +02:00
{{ - 'Lien permanent' -}}
</a>
</p>
{% endif %}
</div>
</div>
{% else %}
{% if not full %}
<h2 class="h2 no-margin">
2021-11-23 22:48:55 +01:00
<a href=" {{ safe_path ( 'blog_menu_post' , { post : post .id , slug : post .slug , _domain : _domain } ) }} ">
2021-03-29 13:58:05 +02:00
{{ - post .title -}}
</a>
</h2>
<ul class="list--inline no-margin">
<li>
<time datetime=" {{ post .publishedAt | date ( "Y-m-d" ) }} " title=" {{ post .publishedAt | date ( "r" ) }} ">
{{ - 'Le ' ~ post .publishedAt | date ( "d/m/Y à H\\hi" ) -}}
</time>
</li>
{% for category in post .categories %}
<li>
2021-11-23 22:48:55 +01:00
<a href=" {{ safe_path ( 'blog_menu_category' , { category : category .id , slug : category .slug , _domain : _domain } ) }} ">
2021-03-29 13:58:05 +02:00
{{ - category .title -}}
</a>
</li>
{% endfor %}
{% for tag in post .tags %}
<li>
2021-11-23 22:48:55 +01:00
<a href=" {{ safe_path ( 'blog_menu_search' , { tag : tag .label , _domain : _domain } ) }} ">
2021-03-30 21:16:52 +02:00
{{ - '#' ~ tag .label -}}
2021-03-29 13:58:05 +02:00
</a>
</li>
{% endfor %}
</ul>
{% endif %}
<div class="body-content">
{% if post .contentFormat == 'html' %}
2022-03-26 14:31:37 +01:00
{{ - post .content | murph_url | file_attributes | post -}}
{% elseif post .contentFormat == 'markdown' %}
{{ - post .content | murph_url | file_attributes | markdown ( 'post' ) | lazy_load -}}
{% elseif post .contentFormat == 'editorjs' %}
{{ - post .content | murph_url | file_attributes | editorjs_to_html | raw -}}
2021-03-29 13:58:05 +02:00
{% endif %}
</div>
{% endif %}
</div>
</div>
{% if full %}
2022-09-11 18:50:04 +02:00
{% set description = setting ( 'post_author_description' ) %}
{% - if description -%}
2022-09-11 19:09:58 +02:00
<div class="body body--posts">
2022-09-11 18:50:04 +02:00
<div class="review review--post">
<ul class="list--unstyled grid">
{% - set avatar = setting ( 'avatar_image' ) -%}
{% - if avatar -%}
<li class="review-avatar">
<img src=" {{ asset ( avatar ) | imagine_filter ( 'site_avatar' ) }} " alt="Simon Vieille" title="Simon Vieille" class="border round">
</li>
{% - endif -%}
<li class="review-content">
{{ - description | markdown ( 'post' ) -}}
</li>
</ul>
</div>
</div>
{% - endif -%}
{% - if similarPosts is defined and similarPosts | length > 0 -%}
2022-09-10 11:12:14 +02:00
<div class="body body--posts">
<div class="col-12 cards cards--posts">
2022-09-09 20:10:51 +02:00
<div class="row">
{% for item in similarPosts %}
2022-09-10 11:12:14 +02:00
<div class="col-4 card-wrapper">
<div class="card">
2022-09-09 20:10:51 +02:00
{% set url = safe_path ( 'blog_menu_post' , { post : item .id , slug : item .slug , _domain : _domain } ) %}
{% - if item .image -%}
2022-09-10 11:12:14 +02:00
<div class="card-preview">
2022-09-09 20:10:51 +02:00
<a href=" {{ url }} ">
{% set image = asset ( item .image ) | imagine_filter ( 'post_preview_filter' ) %}
<img src=" {{ asset ( 'build/images/px.png' ) }} " data-src=" {{ image }} " alt=" {{ item .title }} ">
</a>
</div>
{% - endif -%}
2022-09-10 11:12:14 +02:00
<h2 class="card-title">
2022-09-09 20:10:51 +02:00
<a href=" {{ - url -}} ">
{{ - item .title -}}
</a>
</h2>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
2022-09-11 18:50:04 +02:00
{% - endif -%}
2022-09-09 20:10:51 +02:00
2021-03-29 13:58:05 +02:00
<div class="col-12">
<div class="reviews">
<hr>
2021-03-30 13:40:38 +02:00
{% set comments = post .comments ( {
isActive: true,
isFirstLevel: true
}) %}
2021-03-29 13:58:05 +02:00
2021-03-30 13:40:38 +02:00
{% if comments | length %}
2021-03-29 13:58:05 +02:00
<div class="grid">
2021-03-30 13:40:38 +02:00
{% for comment in comments %}
2021-11-23 22:48:55 +01:00
{{ include ( 'page/post/_comment.html.twig' , { comment : comment , level : 1 } ) }}
2021-03-29 13:58:05 +02:00
{% endfor %}
</div>
{% endif %}
<div class="grid" id="form">
2021-11-23 22:48:55 +01:00
<form class="form col-12" method="POST" data-form-bot action=" {{ safe_url ( 'blog_tech_form_without_javascript' , { page : app .request .uri , _domain : _domain } ) }} ">
2021-03-30 13:40:38 +02:00
{% if comments | length %}
2021-03-29 13:58:05 +02:00
<hr>
{% endif %}
<div class="h4">Ajouter un commentaire</div>
<div class="row">
<div class="field col-6">
{{ form_label ( form .author ) }}
{{ form_widget ( form .author ) }}
{{ form_errors ( form .author ) }}
</div>
<div class="field col-6">
{{ form_label ( form .website ) }}
{{ form_widget ( form .website ) }}
{{ form_errors ( form .website ) }}
</div>
</div>
<div class="row">
<div class="field col-12">
{{ form_label ( form .email ) }}
{{ form_widget ( form .email ) }}
{{ form_errors ( form .email ) }}
</div>
</div>
2022-02-06 19:36:10 +01:00
<div class="row">
<div class="field col-12">
{{ form_label ( form .follow ) }}
{{ form_widget ( form .follow ) }}
{{ form_errors ( form .follow ) }}
</div>
</div>
2021-03-29 13:58:05 +02:00
<div class="field">
<p class="no-margin">
{{ - 'Votre commentaire - Vous pouvez utiliser du markdown ' }}
2021-11-23 22:48:55 +01:00
[<a title="Afficher l'aide" href=" {{ safe_path ( 'blog_tech_mardown' , { _domain : _domain } ) }} " target="_blank">?</a>]
2021-03-29 13:58:05 +02:00
</p>
{{ form_errors ( form .content ) }}
{{ form_widget ( form .content , { attr : { cols : 3 0 , rows : 1 0 }} ) }}
<div class="hidden alert alert-notice-light" id="answer-alert">
<div class="grid">
<div class="col-9">
{{ - 'Vous répondez à un commentaire' -}}
</div>
<div class="col-3 align-right">
<a href="#" id="cancel-answer">
<span class="button small">
{{ - 'Annuler' -}}
</span>
</a>
</div>
</div>
</div>
</div>
2022-05-29 21:04:28 +02:00
<div class="field field-captcha">
{{ form_label ( form .captcha ) }}
{{ form_widget ( form .captcha ) }}
</div>
2021-03-29 13:58:05 +02:00
<div class="field">
<input type="checkbox" id="rgpd" required>
2022-02-07 14:14:36 +01:00
<label for="rgpd">En validant ce formulaire, vous acceptez que les données saisies seront publiées sur cette page à l'exception de votre e-mail. Votre e-mail sera utilisé pour afficher votre avatar (<a href="https://www.libravatar.org/" target="_blank">via Libravatar</a>) et pour les notifications.</label>
2021-03-29 13:58:05 +02:00
</div>
<div class="field">
<input type="submit" class="button" value="Publier" />
<input type="button" class="button alt preview-button" value="Prévisualiser" />
</div>
{{ form_rest ( form ) }}
</form>
<div id="preview" class="review-body col-12"></div>
</div>
</div>
</div>
{% if not post .isQuick %}
{ %
set ld = {
'@context': 'http://schema.org/',
'@type': 'BlogPosting',
'headline': post.title,
'author': {
'@type': 'Person',
'name': 'Simon Vieille'
},
'publisher': {
'@type': 'Organization',
'name': 'Deblan blog',
'logo': {
'@type': 'imageObject',
2021-03-31 14:58:07 +02:00
'url': asset('build/images/logo.png')
2021-03-29 13:58:05 +02:00
}
},
'datePublished': post.publishedAt|date("c"),
'dateModified': post.updatedAt|date("c"),
2021-03-31 14:58:07 +02:00
'image': post.image ? asset(post.image) : null
2021-03-29 13:58:05 +02:00
}
%}
<script type="application/ld+json"> {{ - ld | json_encode ( 1 2 8 ) | replace ( { '\\/' : '/' } ) | raw -}} </script>
{% endif %}
{% endif %}