aboutsummaryrefslogtreecommitdiffstats
path: root/libretube-theme
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-04-11 21:29:35 -0500
committerJesús <heckyel@hyperbola.info>2019-04-11 21:29:35 -0500
commit83d7c945395ade5f31b8ba1437a8b0e3d0209be2 (patch)
treeaa457371aa84ab981cf86c56bdcdb699954fa0ea /libretube-theme
parent74a0016cabe124d7e3114734ef7990f964776863 (diff)
downloadlibretube-83d7c945395ade5f31b8ba1437a8b0e3d0209be2.tar.lz
libretube-83d7c945395ade5f31b8ba1437a8b0e3d0209be2.tar.xz
libretube-83d7c945395ade5f31b8ba1437a8b0e3d0209be2.zip
improve opengraph to video
Diffstat (limited to 'libretube-theme')
-rw-r--r--libretube-theme/templates/article.html19
-rw-r--r--libretube-theme/templates/base.html2
2 files changed, 15 insertions, 6 deletions
diff --git a/libretube-theme/templates/article.html b/libretube-theme/templates/article.html
index 51fb2cc..6e9ffe3 100644
--- a/libretube-theme/templates/article.html
+++ b/libretube-theme/templates/article.html
@@ -18,9 +18,9 @@
{{ translations.entry_hreflang(article) }}
{% endif %}
<meta property="og:title" content="{{ article.title }}">
- <meta property="og:type" content="article">
+ <meta property="og:type" content="video.movie">
<meta property="og:url" content="{{ SITEURL }}/{{ article.url }}">
- <meta property="article:published_time" content="{{ article.date.isoformat() }}">
+ <meta property="video:release_date" content="{{ article.date.isoformat() }}">
{% if article.modified %}
<meta property="article:modified_time" content="{{ article.modified.isoformat() }}">
{% endif %}
@@ -35,13 +35,22 @@
{% endif %}
{% endif %}
<meta property="og:description" content="{{ article.summary|striptags|escape }}"/>
- {% if article.og_image %}
- <meta property="og:image" content="{{ SITEURL }}/{{ article.og_image }}"/>
+ {% if article.image %}
+ <meta property="og:image" content="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/../wp-content/uploads/article/poster/{{ article.image }}"/>
{% elif OPEN_GRAPH_IMAGE %}
<meta property="og:image" content="{{ SITEURL }}/{{ OPEN_GRAPH_IMAGE }}"/>
{% endif %}
+ <!-- videograph -->
+ {% if article.og_video %}
+ <meta property="og:video" content="{{ article.og_video }}">
+ <meta property="og:video:secure_url" content="{{ article.og_video }}">
+ <meta property="og:video:type" content="video/webm">
+ <meta property="og:video:width" content="400">
+ <meta property="og:video:height" content="300">
+ {% endif %}
+ <!-- /videograph -->
{% for tag in article.tags %}
- <meta property="og:tag" content="{{ tag | escape }}">
+ <meta property="og:video:tag" content="{{ tag | escape }}">
{% endfor %}
{% if article.styles %}
diff --git a/libretube-theme/templates/base.html b/libretube-theme/templates/base.html
index c91fb39..99842c1 100644
--- a/libretube-theme/templates/base.html
+++ b/libretube-theme/templates/base.html
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang="{% block html_lang %}{{ DEFAULT_LANG }}{% endblock %}">
- <head prefix="og: http://ogp.me/ns# {% if article %}article: http://ogp.me/ns/article#{% endif%}">
+ <head prefix="og: http://ogp.me/ns# {% if article %}article: http://ogp.me/ns/video#{% endif%}">
{% block head %}
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">