From eb79cee7ef6bdc4a44aabfce10617a18be2b8d96 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 26 Dec 2020 19:07:29 +0100 Subject: Add opengraph support. --- config.toml | 2 +- templates/authors/single.html | 5 +++++ templates/base.html | 26 ++++++++++++++++++++++++-- templates/page.html | 9 +++++++++ templates/tags/single.html | 5 +++++ 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/config.toml b/config.toml index 7efbb00..5731f5b 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,5 @@ # The URL the site will be built for -base_url = "/rabalder" +base_url = "https://volse.net/rabalder" title = "Rabalder" description = "En blogg om samfunn, teknologi, internett, overvåkning og annet grums." diff --git a/templates/authors/single.html b/templates/authors/single.html index f61ac4b..5acc50f 100644 --- a/templates/authors/single.html +++ b/templates/authors/single.html @@ -1,4 +1,9 @@ {% extends "base.html" %} +{% block opengraph %} + + + +{% endblock opengraph %} {% block content %}

{{ trans(key="posts_by", lang=lang) }} {{ term.name }}

diff --git a/templates/base.html b/templates/base.html index 78dcb60..69e836a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,8 +5,30 @@ - {% if page.title %}{{ page.title }}{% else %}{{ config.title }}{% endif %} - + {% if page.title %}{{ page.title }} - {% endif %}{{ config.title }} + + + {% block opengraph %} + + + + + + {% if page.extra['opengraph']['img'] %} + + {% endif %} + + + + + + + {% if page.extra['opengraph']['img'] %} + + {% endif %} + {% endblock opengraph %} + + + + + + +{% endblock opengraph %} + {% block language %} {% set translations = page.translations %} {% include "translation-links.html" %} diff --git a/templates/tags/single.html b/templates/tags/single.html index ab0364c..63660d0 100644 --- a/templates/tags/single.html +++ b/templates/tags/single.html @@ -1,4 +1,9 @@ {% extends "base.html" %} +{% block opengraph %} + + + +{% endblock opengraph %} {% block content %}

Tag: {{ term.name }}

-- cgit v1.2.3