add og meta tags

This commit is contained in:
Yusur 2025-06-14 15:32:30 +02:00
parent 803b725671
commit 690ad71328
3 changed files with 11 additions and 1 deletions

View file

@ -4,6 +4,7 @@
- Fixed bugs in templates introduced in 0.3.2 - Fixed bugs in templates introduced in 0.3.2
- Improved karma management - Improved karma management
- Fixed og: meta tags missing
## 0.3.2 ## 0.3.2

View file

@ -14,6 +14,8 @@
This service is age-restricted; do not access if underage. This service is age-restricted; do not access if underage.
More info: https://{{ domain_name }}/terms More info: https://{{ domain_name }}/terms
--> -->
<meta name="og:site_name" content="{{ app_name }}" />
<meta name="generator" content="{{ app_name }} {{ app_version }}" />
<meta name="csrf_token" content="{{ csrf_token() }}"> <meta name="csrf_token" content="{{ csrf_token() }}">
<link rel="stylesheet" href="{{ url_for_css('style') }}" /> <link rel="stylesheet" href="{{ url_for_css('style') }}" />
{# psa: icons url MUST be supplied by .env via PRIVATE_ASSETS= #} {# psa: icons url MUST be supplied by .env via PRIVATE_ASSETS= #}

View file

@ -5,7 +5,14 @@
{% from "macros/icon.html" import icon, callout with context %} {% from "macros/icon.html" import icon, callout with context %}
{% from "macros/nav.html" import nav_guild, nav_user with context %} {% from "macros/nav.html" import nav_guild, nav_user with context %}
{% block title %}{{ title_tag(p.title + '; from ' + p.topic_or_user().handle()) }}{% endblock %} {% block title %}
{{ title_tag(p.title + '; from ' + p.topic_or_user().handle()) }}
<meta name="og:title" content="{{ p.title }}" />
{# meta name="og:description" coming in 0.4 #}
{% if p.author %}
<meta name="author" content="{{ p.author.display_name or p.author.username }}" />
{% endif %}
{% endblock %}
{% block nav %} {% block nav %}
{% if p.topic %} {% if p.topic %}