Browse Source

Add missing meta-tags for twitter

rafalp 6 years ago
parent
commit
87f06157f4

+ 23 - 0
misago/templates/misago/categories/base.html

@@ -33,6 +33,15 @@
 {% endblock og-title %}
 
 
+{% block twitter-title %}
+  {% if THREADS_ON_INDEX %}
+    {% trans "Categories" %}
+  {% else %}
+    {{ settings.index_title|default:settings.forum_name }}
+  {% endif %}
+{% endblock twitter-title %}
+
+
 {% block og-description %}
   {% if not THREADS_ON_INDEX and settings.index_meta_description %}
     {{ settings.index_meta_description }}
@@ -46,7 +55,21 @@
 {% endblock og-description %}
 
 
+{% block twitter-description %}
+  {% if not THREADS_ON_INDEX and settings.index_meta_description %}
+    {{ settings.index_meta_description }}
+  {% else %}
+    {% blocktrans trimmed count categories=categories|length with forum_name=settings.forum_name %}
+      There is {{ categories }} main category currenty available on the {{ forum_name }}.
+    {% plural %}
+      There are {{ categories }} main categories currenty available on the {{ forum_name }}.
+    {% endblocktrans %}
+  {% endif %}
+{% endblock twitter-description %}
+
+
 {% block og-url %}{% absoluteurl request_path %}{% endblock %}
+{% block twitter-url %}{% absoluteurl request_path %}{% endblock %}
 
 
 {% block content %}

+ 10 - 0
misago/templates/misago/errorpages/403.html

@@ -15,6 +15,7 @@
 
 
 {% block og-title %}{% trans "Page not found" %}{% endblock %}
+{% block twitter-title %}{% trans "Page not found" %}{% endblock %}
 
 
 {% block og-description %}
@@ -26,6 +27,15 @@
 {% endblock %}
 
 
+{% block twitter-description %}
+  {% if message %}
+    {{ message }}
+  {% else %}
+    {% trans "You don't have permission to access this page." %}
+  {% endif %}
+{% endblock %}
+
+
 {% block content %}
 <div class="page page-error page-error-403">
   <div class="page-header-bg"></div>

+ 6 - 0
misago/templates/misago/errorpages/404.html

@@ -11,6 +11,7 @@
 
 
 {% block og-title %}{% trans "Page not found" %}{% endblock %}
+{% block twitter-title %}{% trans "Page not found" %}{% endblock %}
 
 
 {% block og-description %}
@@ -18,6 +19,11 @@
 {% endblock %}
 
 
+{% block twitter-description %}
+{% trans "The link you clicked was incorrect or the page has been moved or deleted." %}
+{% endblock %}
+
+
 {% block content %}
 <div class="page page-error page-error-404">
   <div class="page-header-bg"></div>

+ 6 - 0
misago/templates/misago/errorpages/405.html

@@ -11,6 +11,7 @@
 
 
 {% block og-title %}{% trans "Wrong way" %}{% endblock %}
+{% block twitter-title %}{% trans "Wrong way" %}{% endblock %}
 
 
 {% block og-description %}
@@ -18,6 +19,11 @@
 {% endblock %}
 
 
+{% block twitter-description %}
+{% trans "This page should be reached via form submission or pressing button." %}
+{% endblock %}
+
+
 {% block content %}
 <div class="page page-error page-error-405">
   <div class="page-header-bg"></div>

+ 4 - 6
misago/templates/misago/errorpages/social.html

@@ -5,17 +5,15 @@
 {% block title %}{% trans "Problem with sign in" %} | {{ block.super }}{% endblock %}
 
 
-{% block meta-description %}
-{{ message }}
-{% endblock meta-description %}
+{% block meta-description %}{{ message }}{% endblock %}
 
 
 {% block og-title %}{% trans "Problem with sign in" %}{% endblock %}
+{% block twitter-title %}{% trans "Problem with sign in" %}{% endblock %}
 
 
-{% block og-description %}
-{{ message }}
-{% endblock %}
+{% block og-description %}{{ message }}{% endblock %}
+{% block twitter-description %}{{ message }}{% endblock %}
 
 
 {% block content %}

+ 2 - 0
misago/templates/misago/privacy_policy.html

@@ -6,9 +6,11 @@
 
 
 {% block og-title %}{{ title }}{% endblock %}
+{% block twitter-title %}{{ title }}{% endblock %}
 
 
 {% block og-url %}{% absoluteurl request_path %}{% endblock %}
+{% block twitter-url %}{% absoluteurl request_path %}{% endblock %}
 
 
 {% block content %}

+ 1 - 0
misago/templates/misago/profile/ban_details.html

@@ -6,6 +6,7 @@
 
 
 {% block og-title %}{% trans "Ban details" %} | {{ block.super }}{% endblock %}
+{% block twitter-title %}{% trans "Ban details" %} | {{ block.super }}{% endblock %}
 
 
 {% block section %}

+ 1 - 1
misago/templates/misago/profile/base.html

@@ -53,7 +53,7 @@
 {% block og-image %}
 {% if settings.og_image_avatar_on_profile %}
   {% with profile.avatars|first as og_image %}
-    <meta property="twitter:image" content="{% absoluteurl og_image.url %}" />
+    <meta name="twitter:image" content="{% absoluteurl og_image.url %}" />
     <meta property="og:image" content="{% absoluteurl og_image.url %}" />
     <meta property="og:image:width" content="{{ og_image.size }}" />
     <meta property="og:image:height" content="{{ og_image.size }}" />

+ 1 - 0
misago/templates/misago/profile/details.html

@@ -6,6 +6,7 @@
 
 
 {% block og-title %}{% trans "Details" %} | {{ block.super }}{% endblock %}
+{% block twitter-title %}{% trans "Details" %} | {{ block.super }}{% endblock %}
 
 
 {% block section %}

+ 1 - 0
misago/templates/misago/profile/followers.html

@@ -6,6 +6,7 @@
 
 
 {% block og-title %}{% trans "Followers" %} | {{ block.super }}{% endblock %}
+{% block twitter-title %}{% trans "Followers" %} | {{ block.super }}{% endblock %}
 
 
 {% block section %}

+ 1 - 0
misago/templates/misago/profile/follows.html

@@ -6,6 +6,7 @@
 
 
 {% block og-title %}{% trans "Follows" %} | {{ block.super }}{% endblock %}
+{% block twitter-title %}{% trans "Follows" %} | {{ block.super }}{% endblock %}
 
 
 {% block section %}

+ 1 - 0
misago/templates/misago/profile/posts.html

@@ -6,6 +6,7 @@
 
 
 {% block og-title %}{% trans "Posts" %} | {{ block.super }}{% endblock %}
+{% block twitter-title %}{% trans "Posts" %} | {{ block.super }}{% endblock %}
 
 
 {% block section %}

+ 1 - 0
misago/templates/misago/profile/threads.html

@@ -6,6 +6,7 @@
 
 
 {% block og-title %}{% trans "Threads" %} | {{ block.super }}{% endblock %}
+{% block twitter-title %}{% trans "Threads" %} | {{ block.super }}{% endblock %}
 
 
 {% block section %}

+ 1 - 0
misago/templates/misago/profile/username_history.html

@@ -6,6 +6,7 @@
 
 
 {% block og-title %}{% trans "Username history" %} | {{ block.super }}{% endblock %}
+{% block twitter-title %}{% trans "Username history" %} | {{ block.super }}{% endblock %}
 
 
 {% block section %}

+ 2 - 0
misago/templates/misago/search.html

@@ -6,9 +6,11 @@
 
 
 {% block og-title %}{% trans "Search site" %}{% endblock %}
+{% block twitter-title %}{% trans "Search site" %}{% endblock %}
 
 
 {% block og-url %}{% absoluteurl request_path %}{% endblock %}
+{% block twitter-url %}{% absoluteurl request_path %}{% endblock %}
 
 
 {% block content %}

+ 2 - 0
misago/templates/misago/terms_of_service.html

@@ -6,9 +6,11 @@
 
 
 {% block og-title %}{{ title }}{% endblock %}
+{% block twitter-title %}{{ title }}{% endblock %}
 
 
 {% block og-url %}{% absoluteurl request_path %}{% endblock %}
+{% block twitter-url %}{% absoluteurl request_path %}{% endblock %}
 
 
 {% block content %}

+ 1 - 1
misago/templates/misago/thread/thread.html

@@ -44,7 +44,7 @@
 {% block og-image %}
 {% if settings.og_image_avatar_on_thread and thread.starter %}
   {% with thread.starter.avatars|first as og_image %}
-    <meta property="twitter:image" content="{% absoluteurl og_image.url %}" />
+    <meta name="twitter:image" content="{% absoluteurl og_image.url %}" />
     <meta property="og:image" content="{% absoluteurl og_image.url %}" />
     <meta property="og:image:width" content="{{ og_image.size }}" />
     <meta property="og:image:height" content="{{ og_image.size }}" />

+ 10 - 3
misago/templates/misago/threadslist/category.html

@@ -24,9 +24,8 @@
 {% endblock meta-description %}
 
 
-{% block og-title %}
-  {{ category }}
-{% endblock og-title %}
+{% block og-title %}{{ category }}{% endblock %}
+{% block twitter-title %}{{ category }}{% endblock %}
 
 
 {% block og-description %}
@@ -36,7 +35,15 @@
 {% endblock og-description %}
 
 
+{% block twitter-description %}
+  {% if category.description %}
+    {{ category.description }}
+  {% endif %}
+{% endblock twitter-description %}
+
+
 {% block og-url %}{% absoluteurl request_path %}{% endblock %}
+{% block twitter-url %}{% absoluteurl request_path %}{% endblock %}
 
 
 {% block extra-css %}

+ 10 - 0
misago/templates/misago/threadslist/threads.html

@@ -37,7 +37,17 @@
 {% endblock og-title %}
 
 
+{% block twitter-title %}
+  {% if THREADS_ON_INDEX %}
+    {{ settings.index_title|default:settings.forum_name }}
+  {% else %}
+    {% trans "Threads" %}
+  {% endif %}
+{% endblock twitter-title %}
+
+
 {% block og-url %}{% absoluteurl request_path %}{% endblock %}
+{% block twitter-url %}{% absoluteurl request_path %}{% endblock %}
 
 
 {% block page-header %}

+ 17 - 0
misago/templates/misago/userslists/active_posters.html

@@ -21,6 +21,7 @@
 
 
 {% block og-title %}{% trans "Top posters" %}{% endblock %}
+{% block twitter-title %}{% trans "Top posters" %}{% endblock %}
 
 
 {% block og-description %}
@@ -38,7 +39,23 @@
 {% endblock og-description %}
 
 
+{% block twitter-description %}
+  {% if users_count %}
+    {% blocktrans trimmed with posters=users_count days=tracked_period count counter=users_count %}
+      {{ posters }} top poster from last {{ days }} days.
+    {% plural %}
+      {{ posters }} top posters from last {{ days }} days.
+    {% endblocktrans %}
+  {% else %}
+    {% blocktrans trimmed with days=tracked_period %}
+      No users have posted any new messages during last {{ days }} days.
+    {% endblocktrans %}
+  {% endif %}
+{% endblock twitter-description %}
+
+
 {% block og-url %}{% absoluteurl request_path %}{% endblock %}
+{% block twitter-url %}{% absoluteurl request_path %}{% endblock %}
 
 
 {% block content %}

+ 14 - 3
misago/templates/misago/userslists/rank.html

@@ -31,9 +31,8 @@
 {% endblock meta-extra %}
 
 
-{% block og-title %}
-  {{ rank.name }}
-{% endblock og-title %}
+{% block og-title %}{{ rank.name }}{% endblock %}
+{% block twitter-title %}{{ rank.name }}{% endblock %}
 
 
 {% block og-description %}
@@ -47,7 +46,19 @@
 {% endblock og-description %}
 
 
+{% block twitter-description %}
+  {% if rank.description %}
+    {{ rank.description }}
+  {% endif %} {% blocktrans trimmed count users=paginator.count %}
+    {{ users }} user have this rank.
+  {% plural %}
+    {{ users }} users have this rank.
+  {% endblocktrans %}
+{% endblock twitter-description %}
+
+
 {% block og-url %}{% absoluteurl rank.get_absolute_url %}{% endblock %}
+{% block twitter-url %}{% absoluteurl rank.get_absolute_url %}{% endblock %}
 
 
 {% block content %}