theme/layouts/post/list.html

53 lines
1.8 KiB
HTML

{{ partial "header.html" . }}
{{ partial "navbar.html" . }}
<section class="section">
<div class="container content page">
{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}{{ range $paginator.Pages }}
<div class="card">
<div class="card-content">
<div class="media">
<div class="media-content">
<a class="title is-4" href="{{ .Permalink }}">{{ .Title }}</a>
<p class="subtitle is-6">{{ .Date.Format "Mon Jan 2, 2006" }} {{ i18n "authored_by" }}
{{ if .Params.authors }}
{{ $s := newScratch }}
{{ $s.Set "len" (len .Params.authors) }}
{{ $s.Add "len" -1 }}
{{ range $idx, $author := .Params.authors -}}
<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 "https://" }}{{ .Params.author }}{{ else }}https://gitea.com/{{ .Params.author }}{{ end }}">
{{ path.BaseName (.Params.author | default .Site.Params.author) }}
</a>
{{ end }}
</p>
</div>
</div>
<div class="content">
{{ .Summary }}
</div>
<a href="{{ .Permalink }}" class="button is-success is-outlined">
{{ i18n "read_more" }}
</a>
</div>
</div>
{{ end }}
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
{{ if .Paginator.HasPrev}}
<a class="pagination-previous" href="{{ .Paginator.Prev.URL }}">{{ i18n "page_prev" }}</a>
{{ end }} {{ if .Paginator.HasNext }}
<a class="pagination-next" href="{{ .Paginator.Next.URL }}">{{ i18n "page_next" }}</a>
{{ end }}
</nav>
</div>
</section>
{{ partial "footer.html" . }}