hugo-WonderMod/layouts/_default/list.html

90 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">
{{- partial "breadcrumbs.html" . }}
2020-08-27 10:07:45 -04:00
<h1>{{ .Title }}</h1>
{{- if .Description }}
<div class="post-description">
{{ .Description | markdownify }}
</div>
{{- end }}
2020-08-27 10:07:45 -04:00
</header>
{{- end }}
2021-09-02 04:13:08 -04:00
{{- if .Content }}
2021-09-02 04:03:47 -04:00
<div class="post-content">
{{- if not (.Param "disableAnchoredHeadings") }}
{{- partial "anchored_headings.html" .Content -}}
{{- else }}{{ .Content }}{{ end }}
</div>
2021-09-02 04:13:08 -04:00
{{- end }}
2021-09-02 04:03:47 -04:00
{{- $pages := union .RegularPages .Sections }}
{{- if .IsHome }}
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
2021-03-30 08:37:36 -04:00
{{- end }}
2021-03-30 08:37:36 -04:00
{{- $paginator := .Paginate $pages }}
{{- if and .IsHome .Site.Params.homeInfoParams (eq $paginator.PageNumber 1) }}
{{- partial "home_info.html" . }}
{{- end }}
2021-03-30 08:37:36 -04:00
{{- $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" }}
{{- $user_preferred := or .Site.Params.disableSpecial1stPost .Site.Params.homeInfoParams }}
{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }}
2020-03-09 13:50:02 -04:00
{{- $class = "first-entry" }}
{{- 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 }}">
2021-03-30 08:37:36 -04:00
{{- $isHidden := (.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInList) }}
{{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }}
2019-03-31 08:32:06 -04:00
<header class="entry-header">
<h2>
2021-03-30 08:37:36 -04:00
{{- .Title }}
2021-09-04 02:33:12 -04:00
{{- if .Draft }}<sup><span class="entry-isdraft">&nbsp;&nbsp;[draft]</span></sup>{{- end }}
</h2>
2018-01-08 11:28:39 -05:00
</header>
2021-03-30 08:37:36 -04:00
{{- if (ne (.Param "hideSummary") true) }}
2019-03-31 08:32:06 -04:00
<section class="entry-content">
2021-03-30 08:37:36 -04:00
<p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p>
2019-03-31 08:32:06 -04:00
</section>
{{- end }}
{{- if not (.Param "hideMeta") }}
2019-03-31 08:32:06 -04:00
<footer class="entry-footer">
2020-10-20 09:08:29 -04:00
{{- partial "post_meta.html" . -}}
2018-01-08 11:28:39 -05:00
</footer>
{{- end }}
<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-12-05 09:42:55 -05:00
<a class="prev" href="{{ $paginator.Prev.URL | absURL }}">« {{ i18n "prev_page" }}</a>
2020-03-09 11:56:13 -04:00
{{- end }}
{{- if $paginator.HasNext }}
2020-12-05 09:42:55 -05:00
<a class="next" href="{{ $paginator.Next.URL | absURL }}">{{ 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 }}
2021-03-30 08:37:36 -04:00
{{- end }}{{/* end profileMode */}}
{{- end }}{{- /* end main */ -}}