hugo-WonderMod/layouts/_default/list.html

78 lines
2.6 KiB
HTML
Raw Normal View History

{{- define "main" }}
2019-03-31 08:32:06 -04:00
{{- if (and .Site.Params.profileMode.enabled .IsHome) }}
{{- partial "index_profile.html" . }}
{{- else }} {{/* if not profileMode */}}
2020-08-27 10:07:45 -04:00
{{- if not .IsHome | and .Title }}
2020-08-27 10:07:45 -04:00
<header class="page-header">
<h1>{{ .Title }}</h1>
</header>
{{- end }}
{{- $pages := union .RegularPages .Sections }}
{{- if .IsHome }}
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{- end}}
{{ $paginator := .Paginate $pages }}
{{ $term := .Data.Term}}
2020-03-09 11:56:13 -04:00
{{- range $index, $page := $paginator.Pages }}
2019-03-31 08:32:06 -04:00
2020-03-09 13:50:02 -04:00
{{- $class := "post-entry" }}
2020-03-09 11:56:13 -04:00
{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0)) }}
{{- if .Site.Params.homeInfoParams | or .Site.Params.disableSpecial1stPost}}
{{- partial "home_info.html" . }}
{{- else}}
2020-03-09 13:50:02 -04:00
{{- $class = "first-entry" }}
{{- end }}
{{- else if $term }}
2020-03-09 13:50:02 -04:00
{{- $class = "post-entry tag-entry" }}
2020-03-09 11:56:13 -04:00
{{- end }}
2020-03-09 13:50:02 -04:00
<article class="{{ $class }}">
{{- if .Params.cover.image }}
<figure class="entry-cover">
{{- if (ne .Params.cover.relative true) }}
<img src="{{ .Params.cover.image | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
{{- else}}
<img src="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
{{- end}}
</figure>
{{- end }}
2019-03-31 08:32:06 -04:00
<header class="entry-header">
<h2>
{{ .Title }}
{{- if .Draft }}<div class="entry-isdraft"><sup>&nbsp;&nbsp;[draft]</sup></div>{{- end }}
</h2>
2018-01-08 11:28:39 -05:00
</header>
{{- if (ne .Site.Params.hideSummary true)}}
2019-03-31 08:32:06 -04:00
<section class="entry-content">
2020-07-20 10:23:30 -04:00
<p>{{ .Summary | plainify | htmlUnescape }}...</p>
2019-03-31 08:32:06 -04:00
</section>
{{- end }}
2019-03-31 08:32:06 -04:00
<footer class="entry-footer">
<time>{{ .Date.Format (default "January 2, 2006" .Site.Params.DateFormat) }}</time>
{{- if $.Site.Params.ShowReadingTime }}&nbsp;·&nbsp;
{{- $default_txt := print .ReadingTime " " "min" }}
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
{{- if or .Params.author .Site.Params.author }}&nbsp;·&nbsp;{{- .Params.author | default .Site.Params.author }}{{ end }}
2018-01-08 11:28:39 -05:00
</footer>
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
2018-01-08 11:28:39 -05:00
</article>
2020-03-09 11:56:13 -04:00
{{- end }}
2019-03-31 08:32:06 -04:00
2020-03-09 11:56:13 -04:00
{{- if gt $paginator.TotalPages 1 }}
2019-03-31 08:32:06 -04:00
<footer class="page-footer">
2018-01-08 11:28:39 -05:00
<nav class="pagination">
2020-03-09 11:56:13 -04:00
{{- if $paginator.HasPrev }}
2020-07-26 09:38:27 -04:00
<a class="prev" href="{{ $paginator.Prev.URL }}">« {{ i18n "prev_page" }}</a>
2020-03-09 11:56:13 -04:00
{{- end }}
{{- if $paginator.HasNext }}
2020-07-26 09:38:27 -04:00
<a class="next" href="{{ $paginator.Next.URL }}">{{ i18n "next_page" }} »</a>
2020-03-09 11:56:13 -04:00
{{- end }}
2018-01-08 11:28:39 -05:00
</nav>
</footer>
2020-03-09 11:56:13 -04:00
{{- end }}
2020-08-27 10:07:45 -04:00
{{end}}{{/* end profileMode */}}
{{- end }}{{- /* end main */ -}}