mirror of https://github.com/istio/istio.io.git
Use server-side redirects instead of alias files for better experience. (#3799)
(cherry picked from commit 22f520809f
)
This commit is contained in:
parent
942c4e66d7
commit
554e6ae904
2
Makefile
2
Makefile
|
@ -16,7 +16,7 @@ build:
|
||||||
@$(docker) scripts/build_site.sh
|
@$(docker) scripts/build_site.sh
|
||||||
|
|
||||||
gen: build
|
gen: build
|
||||||
@$(docker) scripts/gen_site.sh "" -minify -no_aliases
|
@$(docker) scripts/gen_site.sh "" -minify
|
||||||
|
|
||||||
opt:
|
opt:
|
||||||
@$(docker) scripts/opt_site.sh
|
@$(docker) scripts/opt_site.sh
|
||||||
|
|
14
config.toml
14
config.toml
|
@ -14,6 +14,9 @@ buildFuture = true
|
||||||
ignoreFiles = [ "OWNERS" ]
|
ignoreFiles = [ "OWNERS" ]
|
||||||
staticDir = ["static", "generated"]
|
staticDir = ["static", "generated"]
|
||||||
|
|
||||||
|
# we use Netlify server-side redirects instead of generated aliases
|
||||||
|
disableAliases = true
|
||||||
|
|
||||||
# MARKDOWN
|
# MARKDOWN
|
||||||
## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday
|
## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday
|
||||||
[blackfriday]
|
[blackfriday]
|
||||||
|
@ -25,12 +28,21 @@ staticDir = ["static", "generated"]
|
||||||
extensions = [""]
|
extensions = [""]
|
||||||
|
|
||||||
[outputs]
|
[outputs]
|
||||||
home = ["HTML", "RSS"]
|
home = ["HTML", "RSS", "REDIR"]
|
||||||
section = ["HTML"]
|
section = ["HTML"]
|
||||||
|
|
||||||
|
[mediaTypes]
|
||||||
|
[mediaTypes."text/netlify"]
|
||||||
|
delimiter = ""
|
||||||
|
|
||||||
[outputFormats]
|
[outputFormats]
|
||||||
[outputFormats.RSS]
|
[outputFormats.RSS]
|
||||||
baseName = "feed"
|
baseName = "feed"
|
||||||
|
[outputFormats.REDIR]
|
||||||
|
mediatype = "text/netlify"
|
||||||
|
baseName = "_redirects"
|
||||||
|
isPlainText = true
|
||||||
|
notAlternative = true
|
||||||
|
|
||||||
[related]
|
[related]
|
||||||
# Only include matches with rank >= threshold. This is a normalized rank between 0 and 100.
|
# Only include matches with rank >= threshold. This is a normalized rank between 0 and 100.
|
||||||
|
|
|
@ -21,4 +21,11 @@ https://istio.netlify.com/* https://istio.io/:splat 301!
|
||||||
/ /zh 302 Language=zh
|
/ /zh 302 Language=zh
|
||||||
|
|
||||||
# Redirect for the helm charts
|
# Redirect for the helm charts
|
||||||
/charts/ https://gcsweb.istio.io/gcs/istio-release/releases/1.1.3/charts/ 301
|
/charts/ https://gcsweb.istio.io/gcs/istio-release/releases/{{ .Site.Data.args.full_version }}/charts/ 301
|
||||||
|
|
||||||
|
# Redirects for all aliases
|
||||||
|
{{- range $p := .Site.Pages -}}
|
||||||
|
{{- range .Aliases }}
|
||||||
|
{{ . | printf "%-35s" }} {{ $p.RelPermalink }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
|
@ -3,12 +3,6 @@ set -e
|
||||||
|
|
||||||
hugo version
|
hugo version
|
||||||
|
|
||||||
if [[ "$3" == "-no_aliases" ]]
|
|
||||||
then
|
|
||||||
HUGO_DISABLEALIASES=true
|
|
||||||
export HUGO_DISABLEALIASES
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$2" == "-no_minify" ]]
|
if [[ "$2" == "-no_minify" ]]
|
||||||
then
|
then
|
||||||
hugo --baseURL "$1"
|
hugo --baseURL "$1"
|
||||||
|
|
Loading…
Reference in New Issue