deblan.io-murph/templates/page/post/default.html.twig
Simon Vieille 8733a3498f
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/deployment/woodpecker Pipeline was successful
update og image for quick post
2023-02-19 19:25:14 +01:00

76 lines
2.5 KiB
Twig

{% extends "page/titled/default.html.twig" %}
{%- block page_title -%}
{{- parent()|build_string(post) -}}
{% endblock %}
{%- block meta_title -%}
{{- parent()|build_string(post) -}}
{% endblock %}
{% block meta_description %}
{{- parent()|build_string(post) -}}
{% endblock %}
{%- block page_subtitle -%}
<ul class="no-margin">
<li class="block">
<time datetime="{{ post.publishedAt|date("Y-m-d") }}" title="{{ post.publishedAt|date("r") }}">
{{- 'Le ' ~ post.publishedAt|format_datetime('full', 'short', locale='fr') -}}
</time>
</li>
{% for category in post.categories %}
<li class="inline-block mt-1">
<a href="{{ safe_path('blog_menu_category', {category: category.id, slug: category.slug, _domain: _domain}) }}">
{{- category.title -}}
</a>
</li>
{% endfor %}
{% for tag in post.tags %}
<li class="inline-block">
<a href="{{ safe_path('blog_menu_search', {tag: tag.label, _domain: _domain}) }}">
{{- '#' ~ tag.label -}}
</a>
</li>
{% endfor %}
</ul>
{% endblock %}
{%- block body -%}
{{ include('page/post/_post.html.twig', {full: true}) }}
{% endblock %}
{%- block openGraph -%}
{% if not post.isQuick %}
{% set name = 'Deblan Blog' %}
{% set title = 'Blog - ' ~ block('meta_title') %}
{% set image = post.image ? absolute_url(asset(post.image)) : null %}
{% else %}
{% set image = null %}
{% if post.image %}
{% set image = absolute_url(asset(post.image)) %}
{% elseif post.quickImage %}
{% set image = post.quickImage %}
{% endif %}
{% set title = block('meta_title') %}
{% set name = '' %}
{% endif %}
<link rel="canonical" href="{{ safe_url(_node.routeName, {post: post.id, slug: post.slug, _domain: _domain}) }}" />
<meta property="og:title" content="{{ _page.ogTitle|build_string(post) }}" />
<meta property="og:url" content="{{ safe_url(_node.routeName, {post: post.id, slug: post.slug, _domain: _domain}) }}" />
{% if image %}
<meta property="og:image" content="{{ image }}" />
<meta property="og:image:secure_url" content="{{ image }}" />
{% endif %}
<meta property="og:site_name" content="{{ name }}" />
<meta property="og:locale" content="fr_FR" />
<meta property="og:type" content="article" />
{% endblock %}