update quick post

This commit is contained in:
Simon Vieille 2022-09-21 10:55:48 +02:00
parent 332e3fd4bb
commit 85048d95c0
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -0,0 +1,84 @@
{% set isVideo = post.quickVideo and post.quickShowVideo and post.quickVideoHeight and post.quickVideoWidth %}
{% set image = post.quickImage ? post.quickImage : (post.image ? asset(post.image) : null) %}
{% set url = post.quickUrl %}
{% set title = post.title %}
{% set content = post.content|murph_url %}
{%- set content -%}
{% if post.contentFormat == 'html' %}
{{- post.content|murph_url|file_attributes|post -}}
{% elseif post.contentFormat == 'markdown' %}
{{- post.content|murph_url|file_attributes|markdown('post') -}}
{% elseif post.contentFormat == 'editorjs' %}
{{- post.content|murph_url|file_attributes|editorjs_to_html -}}
{% endif %}
{%- endset -%}
{%- set more -%}
{% if not full %}
<p class="quick-more">
<a href="{{ safe_path('blog_menu_post', {post: post.id, slug: post.slug, _domain: _domain}) }}">
{{- 'Lien permanent' -}}
</a>
</p>
{% endif %}
{%- endset -%}
{% if isVideo %}
<div class="quick">
<div class="quick-video">
<div class="video-ratio" data-ratio="{{ post.quickVideoHeight * 100 / post.quickVideoWidth }}%">
<iframe src="{{ post.quickVideo }}" allowfullscreen></iframe>
</div>
</div>
<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>
{{- content|raw -}}
{{- more|raw -}}
</div>
</div>
{% elseif not image %}
<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>
{{- content|raw -}}
{{- more|raw -}}
</div>
{% elseif image %}
<div class="col-12">
<div class="quick">
<div class="ejs-link">
<div class="ejs-link--anchor ejs-link--anchor--with-image">
<div class="ejs-link-content">
<div class="ejs-link-content--title">
<p class="no-margin"><a href="{{ url }}">{{- title -}}</a></p>
</div>
<div class="ejs-link-content--description">
{{- content|raw -}}
</div>
</div>
<div class="ejs-link--image" style="background-image: url('{{ image }}')"></div>
</div>
{{- more|raw -}}
</div>
</div>
</div>
{% endif %}