Add Twitter card meta tags for proper link unfurling on Matrix/Discord
Links shared to Matrix/Discord were showing the logo instead of thumbnail1 because twitter:card and twitter:image meta tags were missing. Added complete Twitter card support (summary_large_image) plus og:url and og:site_name for better Open Graph compliance.
This commit is contained in:
parent
e4ec3e0d5e
commit
d0a419afa1
2 changed files with 16 additions and 16 deletions
|
|
@ -7,14 +7,14 @@
|
|||
<meta name="description" content="{{ product.description }}">
|
||||
<meta property="og:description" content="{{ product.description }}" />
|
||||
<meta property="og:type" content="article" />
|
||||
{%- set og_thumbnail = none %}
|
||||
{%- for thumbnail_key in ["thumbnail1", "thumbnail2", "thumbnail3", "thumbnail4"] %}
|
||||
{%- if og_thumbnail is none and thumbnail_key in product.extensions %}
|
||||
{%- set og_thumbnail = thumbnail_key %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- if og_thumbnail %}
|
||||
<meta property="og:image" content="{{ request.app["bucket.secure_uploads.get_endpoint"] }}/{{ product.s3_path }}/{{ og_thumbnail }}?ts={{ product.updated_timestamp }}" />
|
||||
<meta property="og:url" content="{{ product.absolute_url(request) }}" />
|
||||
<meta property="og:site_name" content="{{ request.shop.name }}" />
|
||||
{%- if "thumbnail1" in product.extensions %}
|
||||
<meta property="og:image" content="{{ request.app["bucket.secure_uploads.get_endpoint"] }}/{{ product.s3_path }}/thumbnail1?ts={{ product.updated_timestamp }}" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content="{{ product.title }}" />
|
||||
<meta name="twitter:description" content="{{ product.description }}" />
|
||||
<meta name="twitter:image" content="{{ request.app["bucket.secure_uploads.get_endpoint"] }}/{{ product.s3_path }}/thumbnail1?ts={{ product.updated_timestamp }}" />
|
||||
{%- endif %}
|
||||
|
||||
{# Removed auto-refresh timer - better UX to let download links expire than interrupt reading #}
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@
|
|||
<meta name="description" content="{{ product.description }}">
|
||||
<meta property="og:description" content="{{ product.description }}" />
|
||||
<meta property="og:type" content="article" />
|
||||
{%- set og_thumbnail = none %}
|
||||
{%- for thumbnail_key in ["thumbnail1", "thumbnail2", "thumbnail3", "thumbnail4"] %}
|
||||
{%- if og_thumbnail is none and thumbnail_key in product.extensions %}
|
||||
{%- set og_thumbnail = thumbnail_key %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- if og_thumbnail %}
|
||||
<meta property="og:image" content="{{ request.app["bucket.secure_uploads.get_endpoint"] }}/{{ product.s3_path }}/{{ og_thumbnail }}?ts={{ product.updated_timestamp }}" />
|
||||
<meta property="og:url" content="{{ product.absolute_url(request) }}" />
|
||||
<meta property="og:site_name" content="{{ request.shop.name }}" />
|
||||
{%- if "thumbnail1" in product.extensions %}
|
||||
<meta property="og:image" content="{{ request.app["bucket.secure_uploads.get_endpoint"] }}/{{ product.s3_path }}/thumbnail1?ts={{ product.updated_timestamp }}" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content="{{ product.title }}" />
|
||||
<meta name="twitter:description" content="{{ product.description }}" />
|
||||
<meta name="twitter:image" content="{{ request.app["bucket.secure_uploads.get_endpoint"] }}/{{ product.s3_path }}/thumbnail1?ts={{ product.updated_timestamp }}" />
|
||||
{%- endif %}
|
||||
|
||||
{# Removed auto-refresh timer - better UX to let download links expire than interrupt reading #}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue