Skip to content

Commit

Permalink
Add canonical link and clean alternative link in WUI, related to Alfa…
Browse files Browse the repository at this point in the history
…nous-team#406 SEO issue

* Add canonical link to HTML header with only 'query' as parameter
* Remove the tailing '?' from alternative link in HTML header for empty requests
  • Loading branch information
sneetsher committed May 11, 2017
1 parent da8f3af commit e1e287b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/alfanous-django/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@

<link rel="icon" href="/static/shared/img/icon/icon_32_a.png" sizes="32x32">
<link rel="shortcut icon" href="/static/shared/img/icon/icon_16_a.png">

<link rel="alternate" href="http://www.alfanous.org/{{ current.unit }}/?{{ current.request }}" hreflang="x-default" />

<link rel="canonical" href="http://www.alfanous.org/{{ LANGUAGE_CODE }}/{{ current.unit }}/{% if params.query %}?query={{ params.query }}{% endif %}" />
<link rel="alternate" href="http://www.alfanous.org/{{ current.unit }}/{% if current.request %}?{{ current.request }}{% endif %}" hreflang="x-default" />
{% for lang_code, lang_name in LANGUAGES %}
{% language lang_code %}

<link rel="alternate" href="http://www.alfanous.org{% url 'wui.views.results' current.unit %}?{{ current.request }}" hreflang="{{ lang_code }}" />
<link rel="alternate" href="http://www.alfanous.org{% url 'wui.views.results' current.unit %}{% if current.request %}?{{ current.request }}{% endif %}" hreflang="{{ lang_code }}" />
{% endlanguage %}
{% endfor %}
{% endfor %}

<link rel="search" type="application/opensearchdescription+xml" title="Alfanous" href="/static/alfanous-opensearch.xml"/>

Expand Down

0 comments on commit e1e287b

Please sign in to comment.