Skip to content
Permalink
Browse files

Add <link> even if post is untranslated

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 13, 2016
1 parent cfc8554 commit 188560d3d53564aaa0e5030014a7249e59d4f1d8
@@ -10,6 +10,8 @@ Features
Bugfixes
--------

* Add ``<link>`` tags to other languages even if the post is
untranslated (Google complained otherwise)
* Create Persistor directories only if site is configured (Issue #2334)
* Remove newlines in imported WordPress titles (Issue #2330)

@@ -3,7 +3,7 @@
{% macro meta_translations(post) %}
{% if translations|length > 1 %}
{% for langname in translations|sort %}
{% if langname != lang and post.is_translation_available(langname) %}
{% if langname != lang and (post.show_untranslated or post.is_translation_available(langname)) %}
<link rel="alternate" hreflang="{{ langname }}" href="{{ post.permalink(langname) }}">
{% endif %}
{% endfor %}
@@ -3,7 +3,7 @@
<%def name="meta_translations(post)">
%if len(translations) > 1:
%for langname in sorted(translations):
%if langname != lang and post.is_translation_available(langname):
%if langname != lang and (post.show_untranslated or post.is_translation_available(langname)):
<link rel="alternate" hreflang="${langname}" href="${post.permalink(langname)}">
%endif
%endfor

0 comments on commit 188560d

Please sign in to comment.