Skip to content

Commit

Permalink
Add <link> even if post is untranslated
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 13, 2016
1 parent cfc8554 commit 188560d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion nikola/data/themes/base-jinja/templates/post_helper.tmpl
Expand Up @@ -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 %}
Expand Down
2 changes: 1 addition & 1 deletion nikola/data/themes/base/templates/post_helper.tmpl
Expand Up @@ -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
Expand Down

0 comments on commit 188560d

Please sign in to comment.