Merge pull request #188 from haplo/alternate-links
Set alternate link tags for translated content
This commit is contained in:
commit
0490ead40f
2 changed files with 18 additions and 0 deletions
|
@ -5,6 +5,13 @@
|
||||||
<meta name="description" content="{{ article.summary|striptags|escape }}" />
|
<meta name="description" content="{{ article.summary|striptags|escape }}" />
|
||||||
<meta name="keywords" content="{{ article.tags|join(', ')|escape }}">
|
<meta name="keywords" content="{{ article.tags|join(', ')|escape }}">
|
||||||
|
|
||||||
|
{% if article.translations -%}
|
||||||
|
<link rel="alternate" href="{{ SITEURL }}/{{ article.url }}" hreflang="{{ article.lang }}" />
|
||||||
|
{% for a in article.translations %}
|
||||||
|
<link rel="alternate" href="{{ SITEURL }}/{{ a.url }}" hreflang="{{ a.lang }}" />
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% include "partial/og_article.html" %}
|
{% include "partial/og_article.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,16 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block meta %}
|
||||||
|
{{ super() }}
|
||||||
|
|
||||||
|
{% if page.translations -%}
|
||||||
|
<link rel="alternate" href="{{ SITEURL }}/{{ page.url }}" hreflang="{{ page.lang }}" />
|
||||||
|
{% for p in page.translations %}
|
||||||
|
<link rel="alternate" href="{{ SITEURL }}/{{ p.url }}" hreflang="{{ p.lang }}" />
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block title %} – {{ page.title }}{% endblock %}
|
{% block title %} – {{ page.title }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
Loading…
Reference in a new issue