Skip to content

Commit

Permalink
docs: fix netlify redirects
Browse files Browse the repository at this point in the history
Fixes Netlify redirect commands by adding an extra
path segment aliging the directory properly.

Signed-off-by: Tim Jones <[email protected]>
  • Loading branch information
TimJones committed Apr 20, 2022
1 parent 486f79b commit bb7a50b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/layouts/index.netlify_redirect
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# Use netlify to redirect alias pages
{{- range $p := .Site.Pages }}
{{- range .Aliases }}
{{ printf "%s %s %d" (cond (hasPrefix . "/") . (path.Join $p.RelPermalink .)) $p.RelPermalink ($p.Params.HTTPCode | default 301) }}
{{ printf "%s %s %d" (cond (hasPrefix . "/") . (path.Join $p.RelPermalink ".." .)) (path.Clean $p.RelPermalink) ($p.Params.HTTPCode | default 301) }}
{{- end }}
{{- end }}

0 comments on commit bb7a50b

Please sign in to comment.