Skip to content

Commit

Permalink
Replace aliases with Netlify's _redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Jun 20, 2017
1 parent 5b0e2ea commit 5f31f3a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,26 @@ title = "Hugo: A Fast and Flexible Website Generator"
baseurl = "http://gohugo.io/"
MetaDataFormat = "yaml"
pluralizeListTitles = false
# We do redirects via Netlify's _redirects file, generated by Hugo (see "outputs" below).
disableAliases = true

[blackfriday]
plainIDAnchors = true

[outputs]
home = [ "HTML", "RSS", "REDIR" ]

[mediaTypes]
[mediaTypes."text/netlify"]
suffix = ""
delimiter = ""

[outputFormats]
[outputFormats.REDIR]
mediatype = "text/netlify"
baseName = "_redirects"
isPlainText = true

[params]
description = "Documentation of Hugo, a fast and flexible static site generator built with love by spf13, bep and friends in Go"
author = "Steve Francia (spf13) and friends"
Expand Down
6 changes: 6 additions & 0 deletions layouts/index.redir
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Netlify redirects. See https://www.netlify.com/docs/redirects/
{{ range $p := .Site.Pages -}}
{{ range .Aliases }}
{{ . | printf "%-35s" }} {{ $p.RelPermalink -}}
{{ end -}}
{{- end -}}

0 comments on commit 5f31f3a

Please sign in to comment.