mirror of
https://github.com/welpo/tabi.git
synced 2026-06-09 21:37:34 +02:00
✨ feat: add support for social media cards
Can be set at the post, section and `config.toml`. It respects the hierarchy post > section > config. See #128
This commit is contained in:
parent
e241601f7c
commit
2e75ac7b74
3 changed files with 15 additions and 7 deletions
|
|
@ -73,9 +73,11 @@
|
|||
<meta property="og:title" content="{{ config.title }}">
|
||||
<meta property="og:type" content="article" />
|
||||
|
||||
{% if config.extra.headerImage %}
|
||||
<meta property="og:image" content="{{ config.extra.headerImage }}">
|
||||
<meta name="twitter:card" content="{{ config.extra.headerImage }}">
|
||||
{# Image for social media sharing #}
|
||||
{%- set social_media_card = macros_settings::evaluate_setting_priority(setting="social_media_card", page=page | default(value=""), default_global_value="") -%}
|
||||
{% if social_media_card %}
|
||||
<meta property="og:image" content="{{ get_url(path=social_media_card) }}">
|
||||
<meta name="twitter:card" content="{{ get_url(path=social_media_card) }}">
|
||||
{% endif %}
|
||||
|
||||
{% set current_url = current_url | default(value="/") %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue