From 530e851bd1f74406f641c2366892e5342fbe6b4d Mon Sep 17 00:00:00 2001 From: imperosol Date: Fri, 7 Nov 2025 20:52:10 +0100 Subject: [PATCH] add missing open graph tags --- club/templates/club/club_detail.jinja | 14 +++++++++++++- com/templates/com/news_detail.jinja | 27 +++++++++++++++++++-------- core/templates/core/base.jinja | 22 ++++++++++++++++------ core/templates/core/macros.jinja | 19 ------------------- core/templates/core/page.jinja | 12 ++++++++++++ 5 files changed, 60 insertions(+), 34 deletions(-) diff --git a/club/templates/club/club_detail.jinja b/club/templates/club/club_detail.jinja index 33760695..168c4b6c 100644 --- a/club/templates/club/club_detail.jinja +++ b/club/templates/club/club_detail.jinja @@ -9,6 +9,18 @@ {{ club.short_description }} {%- endblock %} +{% block metatags %} + + + + + {% if club.logo %} + + {% else %} + + {% endif %} +{% endblock %} + {% block content %}
{% if club.logo %} @@ -17,7 +29,7 @@ {% if page_revision %} {{ page_revision|markdown }} {% else %} -

{% trans %}Club{% endtrans %}

+

{{ club.name }}

{% endif %}
{% endblock %} diff --git a/com/templates/com/news_detail.jinja b/com/templates/com/news_detail.jinja index 9ab6acff..a4c9309c 100644 --- a/com/templates/com/news_detail.jinja +++ b/com/templates/com/news_detail.jinja @@ -1,15 +1,20 @@ {% extends "core/base.jinja" %} -{% from 'core/macros.jinja' import user_profile_link, facebook_share, tweet, link_news_logo, gen_news_metatags %} +{% from 'core/macros.jinja' import user_profile_link, link_news_logo %} {% from "com/macros.jinja" import news_moderation_alert %} {% block title %} - {% trans %}News{% endtrans %} - - {{ object.title }} + {% trans %}News{% endtrans %} - {{ object.title }} {% endblock %} -{% block head %} - {{ super() }} - {{ gen_news_metatags(news) }} +{% block description %}{{ news.summary }}{% endblock %} + +{% block metatags %} + + + + + + {% endblock %} @@ -44,8 +49,14 @@
{{ news.summary|markdown }}

{{ news.content|markdown }}
- {{ facebook_share(news) }} - {{ tweet(news) }} + + {% trans %}Share on Facebook{% endtrans %} +

{% trans %}Author: {% endtrans %}{{ user_profile_link(news.author) }}

{% if news.moderator %} diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index 08b5766b..356abdff 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -4,12 +4,22 @@ {% block head %} {% block title %}Association des Étudiants de l'UTBM{% endblock %} - + + + {% block metatags %} + + + + + {% endblock %} diff --git a/core/templates/core/macros.jinja b/core/templates/core/macros.jinja index 990dd184..cb2b04ab 100644 --- a/core/templates/core/macros.jinja +++ b/core/templates/core/macros.jinja @@ -20,25 +20,6 @@ {% endif %} {%- endmacro %} -{% macro gen_news_metatags(news) -%} - - - - - - - - -{%- endmacro %} - -{% macro facebook_share(news) -%} - -{%- endmacro %} - -{% macro tweet(news) -%} - -{%- endmacro %} - {% macro user_mini_profile(user) %}
diff --git a/core/templates/core/page.jinja b/core/templates/core/page.jinja index 862bb216..b676855a 100644 --- a/core/templates/core/page.jinja +++ b/core/templates/core/page.jinja @@ -12,6 +12,18 @@ {% endif %} {% endblock %} +{% block metatags %} + {% if page %} + + + + + + {% else %} + {{ super() }} + {% endif %} +{% endblock %} + {%- macro print_page_name(page) -%} {%- if page -%} {{ print_page_name(page.parent) }} >