flex/templates/page.html
Fidel Ramos d13b9ae0a8
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.
2019-10-27 15:21:23 +00:00

29 lines
821 B
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 %} &ndash; {{ page.title }}{% endblock %}
{% block content %}
<article class="single">
<header>
{% import 'partial/translations.html' as translations with context %}
{{ translations.translations_for(page) }}
<h1 id="{{ page.slug }}">{{ page.title }}</h1>
</header>
<div>
{% block before_content %}{% endblock %}
{% block page_content %}{{ page.content }}{% endblock %}
{% block after_content %}{% endblock %}
</div>
</article>
{% endblock %}