This website works better with JavaScript.
Home
Help
Sign In
jlelse
/
hugo-caddy-redirs
Watch
1
Star
0
Fork
0
Code
Releases
0
Activity
Browse Source
feat: add caddy redirects
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
master
Henrique Dias
1 year ago
commit
07d586705e
3 changed files
with
16 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+6
-0
config.yaml
+3
-0
go.mod
+7
-0
layouts/index.redir.txt
+ 6
- 0
config.yaml
View File
@ -0,0 +1,6 @@
outputFormats:
redir:
mediaType
:
text/plain
baseName
:
redirects
isPlainText
:
true
notAlternative
:
true
+ 3
- 0
go.mod
View File
@ -0,0 +1,3 @@
module
github
.
com
/
hacdias
/
hugo
-
caddy
-
redirs
go
1.13
+ 7
- 0
layouts/index.redir.txt
View File
@ -0,0 +1,7 @@
{{- range $p := .Site.Pages -}}
{{ range .Aliases }}
{{- $trimmed := ( strings.TrimSuffix "/" ( strings.TrimPrefix "/" . ) ) -}}
/{{ $trimmed }} {{ $p.RelPermalink }}
/{{ $trimmed }}/ {{ $p.RelPermalink -}}
{{ end -}}
{{- end -}}
Write
Preview
Loading…
Cancel
Save