Skip to content

Commit

Permalink
Merge pull request #17 from opendata-swiss/add_redirect_for_article
Browse files Browse the repository at this point in the history
Make redirect directly using SITEURL
  • Loading branch information
kovalch authored Nov 11, 2024
2 parents 8e419e1 + dd1a53c commit 515dee8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 0 additions & 7 deletions theme/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
<link rel="apple-touch-icon" href="{{ SITEURL }}/{{ TOUCHICON }}">
{% endif %}

<!-- Redirect logic in the head -->
{% if request.path == '/en/library/ch-dcat-ap.html' %}
<script type="text/javascript">
window.location.href = "https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html";
</script>
{% endif %}

{% block canonical_rel %}{% endblock %}

{% block meta %}
Expand Down
9 changes: 8 additions & 1 deletion theme/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{% extends "article_list.html" %}

{% block canonical_rel %}<link rel="canonical" href="{{ SITEURL }}">{% endblock %}
{% block canonical_rel %}
<link rel="canonical" href="{{ SITEURL }}">
{% if SITEURL == "https://opendata-swiss.github.io/ogd-handbook-site/en/library/ch-dcat-ap.html" %}
<script type="text/javascript">
window.location.href = "https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html";
</script>
{% endif %}
{% endblock %}

{% block banner %}
{% include 'includes/banner.html' %}
Expand Down

0 comments on commit 515dee8

Please sign in to comment.