40 lines
1.1 KiB
HTML
Raw Permalink Normal View History

2022-08-26 15:15:25 +08:00
{{- $posts := "" -}}
{{- if .section -}}
{{- $posts = (where site.RegularPages "Section" .section) -}}
{{- else -}}
{{- if (eq .context.Kind "taxonomy") -}}
{{- $posts = .context.Pages -}}
{{- else -}}
{{- if (eq .context.Kind "term") -}}
{{- $posts = .context.Data.Pages -}}
{{- else -}}
{{- $posts = site.RegularPages }}
{{- end -}}
{{- end -}}
2022-08-26 15:15:25 +08:00
{{- end -}}
{{- $limit_exceeded:= "" -}}
{{- if (and .limit (gt (len $posts) .limit)) -}}
{{- $limit_exceeded = true -}}
{{- else -}}
{{- $limit_exceeded = false -}}
{{ end }}
{{- if (gt (len $posts) 0) }}
{{- if .limit }}
{{ $posts = (first .limit $posts ) }}
{{ end }}
<ul>
{{- range $post := $posts -}}
<li>
<span>{{- ($post.Date | time.Format site.Params.theme_config.date_format) }}</span>
2023-01-01 17:08:14 +08:00
<a href="{{ $post.Permalink | relURL }}">{{ $post.Title }}</a>
2022-08-26 15:15:25 +08:00
</li>
{{ end }}
{{- if and .show_more $limit_exceeded }}
2023-01-01 17:08:14 +08:00
<li><a href="{{ .show_more_url | relURL }}">{{ .show_more_text | default "Show more..." }}</a></li>
2022-08-26 15:15:25 +08:00
{{ end }}
</ul>
{{ end }}