From 832b4b5fdab2019abf41c0f092b7b442c88173dc Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 11 Sep 2022 18:50:04 +0200 Subject: [PATCH] add post footer --- assets/css/app.scss | 4 +++ .../SettingEventSubscriber.php | 4 ++- templates/page/post/_post.html.twig | 25 +++++++++++++++++-- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/assets/css/app.scss b/assets/css/app.scss index cef8d04..0ae7d21 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -509,6 +509,10 @@ pre[class*="language-"] { margin-right: 10px; } + & .review-content p { + margin-top: 0; + } + .review-content { display: inline-block; width: calc(100% - 75px); diff --git a/src/EventSubscriber/SettingEventSubscriber.php b/src/EventSubscriber/SettingEventSubscriber.php index 91674cd..6e81362 100644 --- a/src/EventSubscriber/SettingEventSubscriber.php +++ b/src/EventSubscriber/SettingEventSubscriber.php @@ -37,6 +37,8 @@ class SettingEventSubscriber extends EventSubscriber $this->manager->init('stats_umami_url', '📊 Statistiques', 'Adresse tableau de bord Umami', ''); $this->manager->init('stats_umami_tag', '📊 Statistiques', 'Script Umami', ''); + $this->manager->init('post_author_description', 'Article', 'Description auteur', ''); + // $this->manager->init('giphy_api_key', '🌐 API', 'Clé d\'API Giphy', ''); } @@ -91,7 +93,7 @@ class SettingEventSubscriber extends EventSubscriber ); } - if (in_array($entity->getCode(), ['blog_footer'])) { + if (in_array($entity->getCode(), ['blog_footer', 'post_author_description'])) { $event->setOption('view', 'large'); $builder->add( diff --git a/templates/page/post/_post.html.twig b/templates/page/post/_post.html.twig index f50829a..1b24457 100644 --- a/templates/page/post/_post.html.twig +++ b/templates/page/post/_post.html.twig @@ -104,7 +104,28 @@ {% if full %} - {% if similarPosts is defined and similarPosts|length > 0 %} + {% set description = setting('post_author_description') %} + + {%- if description -%} +
+
+
    + {%- set avatar = setting('avatar_image') -%} + + {%- if avatar -%} +
  • + Simon Vieille +
  • + {%- endif -%} +
  • + {{- description|markdown('post') -}} +
  • +
+
+
+ {%- endif -%} + + {%- if similarPosts is defined and similarPosts|length > 0 -%}
@@ -133,7 +154,7 @@
- {% endif %} + {%- endif -%}