mirror of https://gitea.com/gitea/theme.git
Use custom URL if author starts with `https://` (#125)
Resolves #124 and would allow for something like `author_domain: github.com` if the author instead has a profile there. Co-authored-by: jolheiser <john.olheiser@gmail.com> Reviewed-on: https://gitea.com/gitea/theme/pulls/125 Reviewed-by: delvh <dev.lh@web.de> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: John Olheiser <john+gitea@jolheiser.com> Co-committed-by: John Olheiser <john+gitea@jolheiser.com>
This commit is contained in:
parent
0de5dfc0fe
commit
5e7d82b6cd
|
@ -15,13 +15,13 @@
|
|||
{{ $s.Set "len" (len .Params.authors) }}
|
||||
{{ $s.Add "len" -1 }}
|
||||
{{ range $idx, $author := .Params.authors -}}
|
||||
<a class="author" href="https://gitea.com/{{ $author | default $.Site.Params.author }}">
|
||||
{{ $author | default $.Site.Params.author }}
|
||||
<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="https://gitea.com/{{ .Params.author | default .Site.Params.author }}">
|
||||
{{ .Params.author | default .Site.Params.author }}
|
||||
<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 }}
|
||||
</p>
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
{{ $s.Set "len" (len .Params.authors) }}
|
||||
{{ $s.Add "len" -1 }}
|
||||
{{ range $idx, $author := .Params.authors -}}
|
||||
<a class="author" href="https://gitea.com/{{ $author | default $.Site.Params.author }}">
|
||||
{{ $author | default $.Site.Params.author }}
|
||||
<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="https://gitea.com/{{ .Params.author | default .Site.Params.author }}">
|
||||
{{ .Params.author | default .Site.Params.author }}
|
||||
<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 }}
|
||||
</b>
|
||||
|
|
Loading…
Reference in New Issue