mirror of https://gitea.com/gitea/theme.git
Allow multiple authors (#120)
![preview](https://gitea.com/attachments/2eabf87e-712f-41f5-9e52-28b0fb0bb61e) Co-authored-by: jolheiser <john.olheiser@gmail.com> Reviewed-on: https://gitea.com/gitea/theme/pulls/120 Reviewed-by: pat-s <pat-s@noreply.gitea.io> 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
9237f02532
commit
64f4349699
|
@ -10,9 +10,20 @@
|
||||||
<div class="media-content">
|
<div class="media-content">
|
||||||
<a class="title is-4" href="{{ .Permalink }}">{{ .Title }}</a>
|
<a class="title is-4" href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
<p class="subtitle is-6">{{ .Date.Format "Mon Jan 2, 2006" }} {{ i18n "authored_by" }}
|
<p class="subtitle is-6">{{ .Date.Format "Mon Jan 2, 2006" }} {{ i18n "authored_by" }}
|
||||||
<a href="https://gitea.com/{{ .Params.author | default .Site.Params.author }}">
|
{{ if .Params.authors }}
|
||||||
{{ .Params.author | default .Site.Params.author }}
|
{{ $s := newScratch }}
|
||||||
</a>
|
{{ $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>{{ 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>
|
||||||
|
{{ end }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,9 +13,20 @@
|
||||||
<i>{{ .Date.Format "Mon Jan 2, 2006" }}</i>
|
<i>{{ .Date.Format "Mon Jan 2, 2006" }}</i>
|
||||||
{{ i18n "authored_by" }}
|
{{ i18n "authored_by" }}
|
||||||
<b>
|
<b>
|
||||||
<a href="https://gitea.com/{{ .Params.author | default .Site.Params.author }}">
|
{{ if .Params.authors }}
|
||||||
{{ .Params.author | default .Site.Params.author }}
|
{{ $s := newScratch }}
|
||||||
</a>
|
{{ $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>{{ 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>
|
||||||
|
{{ end }}
|
||||||
</b>
|
</b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,10 @@ $tertiary: #4183c4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.author {
|
||||||
|
display: inline-block !important;
|
||||||
|
}
|
||||||
|
|
||||||
.page .card{
|
.page .card{
|
||||||
margin-bottom: 2em;
|
margin-bottom: 2em;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue