Add a bunch of redirects for old pages (#1066)

The Google Crawl Engine reported a bunch of broken links pointing into istio.io.
This adds redirects so that these links work.

Add a hack such that the gear menu logic that lets you time travel through versions
of the site will insist that if a page existed in a given version, it must also exist
in subsequent versions. This will ensure we always create redirects when we move site
content, and thus avoid breaking links into the site. If a page is moved or removed,
this will lead to rake test errors when checking the content of archive.istio.io.
This commit is contained in:
Martin Taillefer 2018-03-09 09:37:11 -08:00 committed by GitHub
parent cc4af846c7
commit 933b635553
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 38 additions and 24 deletions

View File

@ -10,6 +10,7 @@ redirect_from:
- "/docs/reference/release-notes.html"
- "/release-notes"
- "/docs/welcome/notes/index.html"
- "/docs/references/notes"
toc: false
---

View File

@ -9,7 +9,7 @@ order: 94
layout: blog
type: markdown
redirect_from: /blog/posts/2017/mixer-spof-myth.html
---
{% include home.html %}

View File

@ -7,6 +7,7 @@ order: 10
layout: docs
type: markdown
toc: false
redirect_from: /docs/concepts/traffic-management/manager.html
---
{% include home.html %}

View File

@ -6,6 +6,7 @@ order: 10
layout: docs
type: markdown
redirect_from: /docs/tasks/rate-limiting.html
---
{% include home.html %}

View File

@ -7,6 +7,7 @@ order: 40
layout: docs
type: markdown
toc: false
redirect_from: /docs/tasks/istio-auth.html
---
{% include section-index.html docs=site.docs %}

View File

@ -6,6 +6,7 @@ order: 10
layout: docs
type: markdown
redirect_from: /docs/tasks/zipkin-tracing.html
---
{% include home.html %}

View File

@ -6,6 +6,7 @@ order: 40
layout: docs
type: markdown
redirect_from: /docs/tasks/egress.html
---
{% include home.html %}

View File

@ -6,6 +6,7 @@ order: 30
layout: docs
type: markdown
redirect_from: /docs/tasks/ingress.html
---
{% include home.html %}

View File

@ -6,6 +6,7 @@ order: 10
layout: docs
type: markdown
redirect_from: /docs/tasks/request-routing.html
---
{% include home.html %}

View File

@ -49,29 +49,34 @@
</a>
<ul class="dropdown-menu" aria-labelledby="gearDropdown">
{% assign future_release = true %}
{% for rel in site.data.releases %}
{% assign target = "" %}
{% if current[1] == 'about' %}
{% assign target = "about" %}
{% elsif current[1] == 'blog' %}
{% assign target = "blog" %}
{% elsif current[1] == 'community.html' %}
{% assign target = "community" %}
{% elsif current[1] == 'help' %}
{% assign target = "help" %}
{% elsif current[1] == 'docs' %}
{% assign target = "docs" %}
{% if current[2] == 'reference' %}
{% assign target = "docs/reference" %}
{% elsif current[2] == 'guides' %}
{% assign target = "docs/guides" %}
{% elsif current[2] == 'tasks' %}
{% assign target = "docs/tasks" %}
{% elsif current[2] == 'concepts' %}
{% assign target = "docs/concepts" %}
{% elsif current[2] == 'setup' %}
{% assign target = "docs/setup" %}
{% if future_release %}
{% assign target = page.url | remove_first: "/" %}
{% else %}
{% assign target = "" %}
{% if current[1] == 'about' %}
{% assign target = "about" %}
{% elsif current[1] == 'blog' %}
{% assign target = "blog" %}
{% elsif current[1] == 'community.html' %}
{% assign target = "community" %}
{% elsif current[1] == 'help' %}
{% assign target = "help" %}
{% elsif current[1] == 'docs' %}
{% assign target = "docs" %}
{% if current[2] == 'reference' %}
{% assign target = "docs/reference" %}
{% elsif current[2] == 'guides' %}
{% assign target = "docs/guides" %}
{% elsif current[2] == 'tasks' %}
{% assign target = "docs/tasks" %}
{% elsif current[2] == 'concepts' %}
{% assign target = "docs/concepts" %}
{% elsif current[2] == 'setup' %}
{% assign target = "docs/setup" %}
{% endif %}
{% endif %}
{% endif %}
@ -93,11 +98,12 @@
<li>
{% if site.data.istio.version == rel.name %}
<i class='fa fa-check'></i>
{{rel.name}}
{% assign future_release = false %}
{% else %}
<i style="visibility: hidden;" class='fa fa-check'></i>
<a href="{{rel.url}}/{{target}}">{{rel.name}}</a>
{% endif %}
<a href="{{rel.url}}/{{target}}">{{rel.name}}</a>
</li>
{% endfor %}