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
{% if false and post .quickVideo and post .quickVideoHeight and post .quickVideoWidth %}
<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 -}}
2021-03-29 13:58:05 +02:00
{% endif %}
{% if post .contentFormat == 'markdown' %}
2021-07-09 23:42:38 +02:00
{{ - post .content | murph_url | file_attributes | markdown ( 'post' ) -}}
2021-03-29 13:58:05 +02:00
{% endif %}
{% if not full %}
<p>
<a href=" {{ safe_path ( 'blog_menu_post' , { post : post .id , slug : post .slug } ) }} ">
{{ - 'Lien permanent' -}}
</a>
</p>
{% endif %}
</div>
</div>
{% else %}
{% if not full %}
<h2 class="h2 no-margin">
<a href=" {{ safe_path ( 'blog_menu_post' , { post : post .id , slug : post .slug } ) }} ">
{{ - 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>
<a href=" {{ safe_path ( 'blog_menu_category' , { category : category .id , slug : category .slug } ) }} ">
{{ - category .title -}}
</a>
</li>
{% endfor %}
{% for tag in post .tags %}
<li>
2021-03-30 21:16:52 +02:00
<a href=" {{ safe_path ( 'blog_menu_search' , { tag : tag .label } ) }} ">
{{ - '#' ~ tag .label -}}
2021-03-29 13:58:05 +02:00
</a>
</li>
{% endfor %}
</ul>
{% endif %}
<div class="body-content">
{% if post .contentFormat == 'html' %}
2021-05-29 13:02:12 +02:00
{{ - post .content | murph_url | post -}}
2021-03-29 13:58:05 +02:00
{% endif %}
{% if post .contentFormat == 'markdown' %}
2021-05-29 13:02:12 +02:00
{{ - post .content | murph_url | markdown ( 'post' ) | lazy_load -}}
2021-03-29 13:58:05 +02:00
{% endif %}
</div>
{% endif %}
</div>
</div>
{% if full %}
<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 %}
{{ include ( 'blog/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-03-30 13:40:38 +02:00
<form class="form col-12" method="POST" data-form-bot action=" {{ safe_url ( 'blog_tech_form_without_javascript' , { page : app .request .uri } ) }} ">
{% 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>
<div class="field">
<p class="no-margin">
{{ - 'Votre commentaire - Vous pouvez utiliser du markdown ' }}
2021-03-30 13:40:38 +02:00
[<a title="Afficher l'aide" href=" {{ safe_path ( 'blog_tech_mardown' ) }} " 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>
<div class="field">
<input type="checkbox" id="rgpd" required>
2021-04-13 11:50:59 +02: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.</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 %}