tilde-site/templates/macros/opengraph.html

12 lines
417 B
HTML
Raw Permalink Normal View History

2023-01-25 08:55:24 +00:00
{% macro opengraph(title, url, content, type="", image="") %}
<meta property="og:title" content="{{ title }}" />
<meta property="og:url" content="{{ url }}" />
<meta property="og:description" content="{{ content | safe | truncate(length=144) }}" />
{% if image %}
<meta property="og:image" content="{{ image }}" />
{% endif %}
{% if type %}
<meta property="og:type" content="{{ type }}" />
{% endif %}
{% endmacro %}