Add func-url.html

This commit is contained in:
Will Faught
2022-12-31 23:42:03 -08:00
parent b20b0008bc
commit 168be4b1a4
5 changed files with 16 additions and 24 deletions

View File

@@ -0,0 +1,12 @@
{{ $url := . }}
{{ if eq $url (urls.Parse $url).Path }}
{{ with resources.Get (relLangURL $url) }}
{{ if ne .ResourceType "image" }}
{{ $url = $url | minify }}
{{ end }}
{{ $url = (. | fingerprint).RelPermalink }}
{{ else }}
{{ $url = relLangURL $url }}
{{ end }}
{{ end }}
{{ return $url }}