Add opengraph

This commit is contained in:
samaradel
2022-04-17 15:25:22 +02:00
parent ff19c0597c
commit 0b8d8f16db

View File

@@ -5,12 +5,36 @@
{% set zolaVer = '0.13.0' %} {% set zolaVer = '0.13.0' %}
<head> <head>
<meta name="generator" content="Zola v.{{ zolaVer }} - getzola.org" />
{% block title %} {% block title %}
{% if current_path == '/' %} {% if current_path == '/' %}
<title>{{ config.title }}</title> <title>{{ config.title }}</title>
<meta property="og:title" content="{{ config.title }}" /> <meta property="og:type" content="website" />
<meta property="og:site_name" content="{{ config.base_url }}" />
{%if section.title%}
<title>{{ section.title }}</title>
<meta name="og:title" content="{{ section.title }}" />
{%endif%}
{%if page.title%}
<title>{{ page.title }}</title>
<meta name="og:title" content="{{ page.title }}" />
{%endif%}
{%if section.extra.imgPath %}
<meta name="image" content="{{ section.extra.imgPath }}" />
<meta name="og:image" content="{{ section.extra.imgPath }}" />
{%endif%}
{%if page.extra.imgPath%}
<meta name="image" content="{{ page.extra.imgPath }}" />
<meta name="og:image" content="{{ page.extra.imgPath }}" />
{%endif%}
{%if section.description%}
<meta name="description" content="{{ section.description }}" />
<meta name="og:description" content="{{ section.description }}" />
{%endif%}
{%if page.description%}
<meta name="description" content="{{ page.description }}" />
<meta name="og:description" content="{{ page.description }}" />
{%endif%}
{% else %} {% else %}
<title>{% if section.title %}{{ section.title }} &bull; {% endif %}{% if page.title %}{{ page.title }} &bull; {% endif %}{{ config.title }}</title> <title>{% if section.title %}{{ section.title }} &bull; {% endif %}{% if page.title %}{{ page.title }} &bull; {% endif %}{{ config.title }}</title>
<meta property="og:title" content="{% if section.title %}{{ section.title }} &bull; {% endif %}{% if page.title %}{{ page.title }} &bull; {% endif %}{{ config.title }}" /> <meta property="og:title" content="{% if section.title %}{{ section.title }} &bull; {% endif %}{% if page.title %}{{ page.title }} &bull; {% endif %}{{ config.title }}" />