chore: check for https:// prefix

Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
jolheiser 2023-03-09 17:00:43 -06:00
parent 7c33619e3f
commit 15406ce8ac
No known key found for this signature in database
GPG Key ID: B853ADA5DA7BBF7A
2 changed files with 4 additions and 4 deletions

View File

@ -15,12 +15,12 @@
{{ $s.Set "len" (len .Params.authors) }}
{{ $s.Add "len" -1 }}
{{ range $idx, $author := .Params.authors -}}
<a class="author" href="{{ if hasPrefix $author "http" }}{{ $author }}{{ else }}https://gitea.com/{{ $author }}{{ end }}">
<a class="author" href="{{ if hasPrefix $author "https://" }}{{ $author }}{{ else }}https://gitea.com/{{ $author }}{{ end }}">
{{ path.BaseName $author }}
</a>{{ if ne $idx ($s.Get "len") }}, {{end}}
{{- end }}
{{ else }}
<a class="author" href="{{ if hasPrefix .Params.author "http" }}{{ .Params.author }}{{ else }}https://gitea.com/{{ .Params.author }}{{ end }}">
<a class="author" href="{{ if hasPrefix .Params.author "https://" }}{{ .Params.author }}{{ else }}https://gitea.com/{{ .Params.author }}{{ end }}">
{{ path.BaseName (.Params.author | default .Site.Params.author) }}
</a>
{{ end }}

View File

@ -18,12 +18,12 @@
{{ $s.Set "len" (len .Params.authors) }}
{{ $s.Add "len" -1 }}
{{ range $idx, $author := .Params.authors -}}
<a class="author" href="{{ if hasPrefix $author "http" }}{{ $author }}{{ else }}https://gitea.com/{{ $author }}{{ end }}">
<a class="author" href="{{ if hasPrefix $author "https://" }}{{ $author }}{{ else }}https://gitea.com/{{ $author }}{{ end }}">
{{ path.BaseName $author }}
</a>{{ if ne $idx ($s.Get "len") }}, {{end}}
{{- end }}
{{ else }}
<a class="author" href="{{ if hasPrefix .Params.author "http" }}{{ .Params.author }}{{ else }}https://gitea.com/{{ .Params.author }}{{ end }}">
<a class="author" href="{{ if hasPrefix .Params.author "https://" }}{{ .Params.author }}{{ else }}https://gitea.com/{{ .Params.author }}{{ end }}">
{{ path.BaseName (.Params.author | default .Site.Params.author) }}
</a>
{{ end }}