Skip to content

Commit afbec0d

Browse files
craigboxAritraDey-Dev
authored andcommitted
make /latest the latest (#16680)
1 parent dc5dee0 commit afbec0d

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

content/en/_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"url": "https://istio.io/",
2222
"potentialAction": {
2323
"@type": "SearchAction",
24-
"target": "https://istio.io/search?q={search_term_string}",
24+
"target": "https://istio.io/latest/search?q={search_term_string}",
2525
"query-input": "required name=search_term_string"
2626
}
2727
}

layouts/index.redir

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@ https://istio.netlify.com/* https://istio.io/:splat 301!
6060
/favicon.ico /latest/favicons/favicon.ico 200
6161
/logos/* /latest/logos/:splat
6262

63-
# navigating to a page without /latest on front, add /latest
64-
{{ range $p := .Site.Pages }}
65-
{{ strings.TrimPrefix "/latest" $p.Permalink }} {{ $p.Permalink}}
66-
{{ strings.TrimPrefix "/latest" (printf "%s.html" (substr $p.Permalink 0 -1)) }} {{ $p.Permalink}}
67-
{{- end }}
63+
# Redirect root paths without /latest
64+
/about/* /latest/about/:splat
65+
/blog/* /latest/blog/:splat
66+
/docs/* /latest/docs/:splat
67+
/get-involved/* /latest/get-involved/:splat
68+
/news/* /latest/news/:splat
69+
/search/* /latest/search/:splat
70+
/test/* /latest/test/:splat
6871

6972
# redirect current version to /latest
7073
/v{{ .Site.Data.args.version }}/* /latest/:splat
@@ -75,15 +78,11 @@ https://istio.netlify.com/* https://istio.io/:splat 301!
7578
# migration from old design to new
7679
/about / 301!
7780
/latest/about /latest 301!
78-
# /faq/ /about/faq
79-
/faq/* /about/faq/
80-
# /latest/faq/ /about/faq
81-
/latest/faq/* /about/faq/
82-
/about/faq/* /about/faq/
83-
/latest/about/faq/* /about/faq/
81+
/faq/* /latest/about/faq/
82+
/latest/faq/* /latest/about/faq/
83+
/about/faq/* /latest/about/faq/
8484

8585
# media-resources page
86-
8786
/about/media-resources https://github.com/cncf/artwork/tree/master/projects/istio
8887
/latest/about/media-resources https://github.com/cncf/artwork/tree/master/projects/istio
8988
/about/zh/media-resources https://github.com/cncf/artwork/tree/master/projects/istio

layouts/partials/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
{{ end }}
6666
<input type="hidden" name="ie" value="utf-8" />
6767
<input type="hidden" name="hl" value="{{ .Page.Lang }}" />
68-
<input type="hidden" id="search-page-url" value="{{ "/search" | relLangURL }}" />
68+
<input type="hidden" id="search-page-url" value="{{ "/latest/search" | relLangURL }}" />
6969
<input id="search-textbox" class="search-textbox form-control" name="q" type="search" aria-label='{{ i18n "search" }}' placeholder='{{ i18n "search_label" }}' />
7070
<button id="search-close" title='{{ i18n "search_cancel" }}' type="reset" aria-label='{{ i18n "search_cancel" }}'>{{ partial "icon.html" "menu-close" }}</button>
7171
</form>

0 commit comments

Comments
 (0)