1

some in-progress opengraph support

This commit is contained in:
Evan Pratten 2022-12-14 11:27:08 -05:00
parent 7d4dbfd1d9
commit 33ae2bef34
3 changed files with 22 additions and 0 deletions

View File

@ -8,6 +8,12 @@ draft: false
extra:
icon: las la-music
excerpt: '"Channels" is a single by Evan Pratten, released on November 25, 2022.'
opengraph:
song:
duration: 3:24
artists:
- first_name: Evan
last_name: Pratten
---
I just published a new song!

View File

@ -18,4 +18,17 @@
{# Article-specifics #}
{% if is_article %}
<meta property="og:type" content="article" />
{% endif %}
{# music specifics #}
{% if opengraph %}
{% if opengraph.song %}
<meta property="og:type" content="music.song" />
<meta property="music:duration" content="{{opengraph.song.duration}}" />
{% endif %}
{% if opengraph.album %}
<meta property="og:type" content="music.album" />
<meta property="music:release_date" content="{{opengraph.song.duration}}" />
{% endif %}
{% endif %}

View File

@ -32,6 +32,9 @@
{% if page.extra.redir_to %}
{% set redirect_target = page.extra.redir_to %}
{% endif %}
{% if page.extra.opengraph %}
{% set opengraph = page.extra.opengraph %}
{% endif %}
{% endblock variable_wormhole %}
{# Page content #}