Skip to content

Commit c1ab989

Browse files
committed
Replace aliases with Netlify's _redirects
See gohugoio/hugo#3613 See gohugoio/hugo#3614
1 parent 5b0e2ea commit c1ab989

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

‎config.toml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,27 @@ title = "Hugo: A Fast and Flexible Website Generator"
22
baseurl = "http://gohugo.io/"
33
MetaDataFormat = "yaml"
44
pluralizeListTitles = false
5+
# We do redirects via Netlify's _redirects file, generated by Hugo (see "outputs" below).
6+
disableAliases = true
57

68
[blackfriday]
79
plainIDAnchors = true
810

11+
[outputs]
12+
home = [ "HTML", "RSS", "REDIR" ]
13+
14+
[mediaTypes]
15+
[mediaTypes."text/netlify"]
16+
suffix = ""
17+
delimiter = ""
18+
19+
[outputFormats]
20+
[outputFormats.REDIR]
21+
mediatype = "text/netlify"
22+
baseName = "_redirects"
23+
isPlainText = true
24+
notAlternative = true
25+
926
[params]
1027
description = "Documentation of Hugo, a fast and flexible static site generator built with love by spf13, bep and friends in Go"
1128
author = "Steve Francia (spf13) and friends"

‎layouts/index.redir‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Netlify redirects. See https://www.netlify.com/docs/redirects/
2+
{{ range $p := .Site.Pages -}}
3+
{{ range .Aliases }}
4+
{{ . | printf "%-35s" }} {{ $p.RelPermalink -}}
5+
{{ end -}}
6+
{{- end -}}

0 commit comments

Comments
 (0)