deblan.io-murph/templates/page/post/default.html.twig

76 lines
2.5 KiB
Twig
Raw Normal View History

2021-11-23 22:48:55 +01:00
{% extends "page/titled/default.html.twig" %}
2021-11-24 00:06:58 +01:00
{%- block page_title -%}
2021-11-23 22:48:55 +01:00
{{- parent()|build_string(post) -}}
{% endblock %}
2021-11-24 00:06:58 +01:00
{%- block meta_title -%}
2021-11-23 22:48:55 +01:00
{{- parent()|build_string(post) -}}
{% endblock %}
2021-11-24 00:06:58 +01:00
{% block meta_description %}
2021-11-23 22:48:55 +01:00
{{- parent()|build_string(post) -}}
{% endblock %}
{%- block page_subtitle -%}
2022-12-29 19:18:09 +01:00
<ul class="no-margin">
<li class="block">
<time datetime="{{ post.publishedAt|date("Y-m-d") }}" title="{{ post.publishedAt|date("r") }}">
2023-02-06 13:48:52 +01:00
{{- 'Le ' ~ post.publishedAt|format_datetime('full', 'short', locale='fr') -}}
</time>
</li>
2022-12-29 19:18:09 +01:00
{% for category in post.categories %}
2022-12-29 19:18:09 +01:00
<li class="inline-block mt-1">
2021-11-23 22:48:55 +01:00
<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 %}
2022-12-29 19:18:09 +01:00
<li class="inline-block">
2021-11-23 22:48:55 +01:00
<a href="{{ safe_path('blog_menu_search', {tag: tag.label, _domain: _domain}) }}">
2021-03-30 21:27:57 +02:00
{{- '#' ~ tag.label -}}
</a>
</li>
{% endfor %}
</ul>
{% endblock %}
{%- block body -%}
2021-11-23 22:48:55 +01:00
{{ include('page/post/_post.html.twig', {full: true}) }}
{% endblock %}
2021-03-30 19:36:16 +02:00
{%- block openGraph -%}
{% if not post.isQuick %}
{% set name = 'Deblan Blog' %}
{% set title = 'Blog - ' ~ block('meta_title') %}
2021-11-10 11:01:43 +01:00
{% set image = post.image ? absolute_url(asset(post.image)) : null %}
{% else %}
2021-04-21 10:42:20 +02:00
{% set image = null %}
2023-02-19 19:25:14 +01:00
{% if post.image %}
2021-11-10 11:01:43 +01:00
{% set image = absolute_url(asset(post.image)) %}
2023-02-19 19:25:14 +01:00
{% elseif post.quickImage %}
{% set image = post.quickImage %}
2021-04-21 10:42:20 +02:00
{% endif %}
{% set title = block('meta_title') %}
{% set name = '' %}
{% endif %}
2021-11-23 22:48:55 +01:00
<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}) }}" />
2021-03-30 19:36:16 +02:00
{% 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 %}