Set alternate link tags for translated content
`<link rel="alternate">` is good practice for SEO and helps people find the content in their preferred language.
This commit is contained in:
parent
6caa5009f9
commit
d13b9ae0a8
2 changed files with 18 additions and 0 deletions
|
@ -1,5 +1,16 @@
|
|||
{% 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 content %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue