{% extends 'base.html.twig' %} {% trans_default_domain "Social" %} {# --- Compute SEO variables once --- #} {% set authorName = post.user.firstName ~ ' ' ~ post.user.lastName %} {% set postSnippet = post.contentPreview(200)|striptags %} {# Determine best title and description depending on post type #} {% if post.sharedResearch %} {% set seoTitle = authorName ~ ' — ' ~ (post.sharedResearch.arabicFullTitle ?: post.sharedResearch.englishFullTitle) %} {% set seoDescription = postSnippet ?: (post.sharedResearch.arabicAbstract ?: post.sharedResearch.englishAbstract)|striptags|slice(0, 200) %} {% elseif resolvedPaper is defined and resolvedPaper %} {% set seoTitle = authorName ~ ' — ' ~ resolvedPaper.title %} {% set seoDescription = postSnippet ?: resolvedPaper.abstract|striptags|slice(0, 200) %} {% else %} {% set seoTitle = authorName ~ ': ' ~ postSnippet|slice(0, 80) %} {% set seoDescription = postSnippet %} {% endif %} {# Author image (absolute URL) #} {% set seoImage = app.request.schemeAndHttpHost ~ post.user.webPath %} {# Post image overrides author avatar when available #} {% if post.image %} {% set seoImage = app.request.schemeAndHttpHost ~ '/uploads/posts/' ~ post.image %} {% endif %} {% set postUrl = app.request.schemeAndHttpHost ~ path('show_profile_post', {'slug': post.slug}) %} {# --- Page Title --- #} {% block title %}{{ seoTitle }}{% endblock %} {# --- Meta Description --- #} {% block metaDescription %}{{ seoDescription|slice(0, 160) }}{% endblock %} {# --- OpenGraph --- #} {% block fb_open_graph %} {% endblock %} {# --- Twitter Card --- #} {% block twitter_cards %} {% endblock %} {# --- Canonical URL --- #} {% block canonical_url %} {% endblock %} {# --- Structured Data (JSON-LD) --- #} {% block structured_data %} {% endblock %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block body %}
{{ 'social.comments'|trans }}
{{ post.commentsCount }}{{ 'social.no_comments_yet'|trans }}