Генерация метатегов социальных сетей [closes #33]
parent
9e5af50a4b
commit
4040954244
|
@ -3,6 +3,7 @@
|
||||||
<html lang="{{request.locale_name}}">
|
<html lang="{{request.locale_name}}">
|
||||||
<head>
|
<head>
|
||||||
{%- block head %}
|
{%- block head %}
|
||||||
|
<title>{{title}}</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
@ -15,11 +16,34 @@
|
||||||
{%- if feed is defined %}
|
{%- if feed is defined %}
|
||||||
<link rel="alternate" type="application/atom+xml" title="Atom feed" href="{{feed['links']['atom']}}">
|
<link rel="alternate" type="application/atom+xml" title="Atom feed" href="{{feed['links']['atom']}}">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
<title>{{title}}</title>
|
{%- block links %}
|
||||||
{% block links %}
|
|
||||||
{%- endblock %}
|
{%- endblock %}
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="theme-color" content="#333333">
|
<meta name="theme-color" content="#333333">
|
||||||
|
<meta name="twitter:title" content="{{title}}">
|
||||||
|
<meta property="og:title" content="{{title}}" />
|
||||||
|
<meta property="og:url" content="{{data.base_url|join_url(request.path_qs)}}" />
|
||||||
|
<meta property="og:type" content="article" />
|
||||||
|
<meta name="twitter:card" content="{{summary or description}}">
|
||||||
|
<meta name="twitter:description" content="{{description}}">
|
||||||
|
<meta property="og:description" content="{{description}}">
|
||||||
|
<meta property="og:locale" content="{{request.locale_name}}" />
|
||||||
|
{%- if feed and 'twitter' in feed['links'] %}
|
||||||
|
<meta name="twitter:site" content="@{{feed['links']['twitter']}}">
|
||||||
|
{%- endif %}
|
||||||
|
{%- if author and 'twitter' in author %}
|
||||||
|
<meta name="twitter:creator" content="@{{author['twitter']}}">
|
||||||
|
{%- endif %}
|
||||||
|
{%- if image %}
|
||||||
|
<meta name="twitter:image" content="{{image}}">
|
||||||
|
<meta property="og:image" content="{{image}}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if published %}
|
||||||
|
<meta property="article:published_time" content="{{published.isoformat()}}Z" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if updated %}
|
||||||
|
<meta property="article:modified_time" content="{{updated.isoformat()}}Z" />
|
||||||
|
{%- endif %}
|
||||||
{%- if json_ld %}
|
{%- if json_ld %}
|
||||||
<script type="application/ld+json">
|
<script type="application/ld+json">
|
||||||
{{ json_ld | merge_dict({"@context": "http://schema.org"}) | tojson }}
|
{{ json_ld | merge_dict({"@context": "http://schema.org"}) | tojson }}
|
||||||
|
|
Reference in New Issue