hugo-theme-cybercards/layouts/partials/list-item.html

29 lines
870 B
HTML

{{ range . -}}
<li>
{{- $page := . -}}
{{- $url := "" -}}
{{- $anchor := "" -}}
{{- $btext := "" -}}
{{- $btitle := "" -}}
{{- if reflect.IsMap . -}}
{{- $anchor = .anchor -}}
{{- $page = .page -}}
{{- with .btext -}}{{- $btext = printf " (%s)" . -}}{{- end -}}
{{- $btitle = .btitle -}}
{{- end -}}
{{- if ne $anchor "" -}}
{{- $url = printf "%s#%v" $page.Permalink $anchor -}}
{{- else -}}
{{- $url = $page.Permalink -}}
{{- end -}}
<a href="{{ $url }}" title="{{ $btitle }}">{{ $page.Title }}{{ $btext }}&nbsp;&nbsp;
{{ if $page.Date -}}
{{- if not .Params.nodate -}}
<small>{{ $page.Date.Format (i18n "dateFormat") }}</small>
{{- end -}}
{{- else if $page.Params.Teaser -}}<small>{{ $page.Params.Teaser }}</small>
{{- else -}}<small>{{ $page.Summary }}</small>
{{- end }}
</a>
</li>
{{- end }}