feat: add caddy redirects
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
commit
07d586705e
|
@ -0,0 +1,6 @@
|
|||
outputFormats:
|
||||
redir:
|
||||
mediaType: text/plain
|
||||
baseName: redirects
|
||||
isPlainText: true
|
||||
notAlternative: true
|
|
@ -0,0 +1,7 @@
|
|||
{{- range $p := .Site.Pages -}}
|
||||
{{ range .Aliases }}
|
||||
{{- $trimmed := ( strings.TrimSuffix "/" ( strings.TrimPrefix "/" . ) ) -}}
|
||||
/{{ $trimmed }} {{ $p.RelPermalink }}
|
||||
/{{ $trimmed }}/ {{ $p.RelPermalink -}}
|
||||
{{ end -}}
|
||||
{{- end -}}
|
Reference in New Issue