2020-09-23 09:22:32 +02:00
|
|
|
{{- define "main" }}
|
2019-03-31 14:32:06 +02:00
|
|
|
|
2020-09-23 09:22:32 +02:00
|
|
|
{{- if (and .Site.Params.profileMode.enabled .IsHome) }}
|
2020-09-23 14:53:57 +02:00
|
|
|
{{- partial "index_profile.html" . }}
|
2020-09-23 09:22:32 +02:00
|
|
|
{{- else }} {{/* if not profileMode */}}
|
2020-08-27 16:07:45 +02:00
|
|
|
|
2020-09-11 20:36:58 +02:00
|
|
|
{{- if not .IsHome | and .Title }}
|
2020-08-27 16:07:45 +02:00
|
|
|
<header class="page-header">
|
2021-02-08 16:00:34 +01:00
|
|
|
{{- partial "breadcrumbs.html" . }}
|
2020-08-27 16:07:45 +02:00
|
|
|
<h1>{{ .Title }}</h1>
|
2021-01-27 16:49:21 +01:00
|
|
|
{{- if .Description }}
|
|
|
|
<div class="post-description">
|
|
|
|
{{ .Description }}
|
|
|
|
</div>
|
|
|
|
{{- end }}
|
2020-08-27 16:07:45 +02:00
|
|
|
</header>
|
2020-09-23 09:22:32 +02:00
|
|
|
{{- end }}
|
2020-09-19 13:59:05 +02:00
|
|
|
|
2020-10-13 14:47:39 +02:00
|
|
|
{{- $pages := union .RegularPages .Sections }}
|
2020-09-11 20:36:58 +02:00
|
|
|
|
2020-09-23 09:22:32 +02:00
|
|
|
{{- if .IsHome }}
|
|
|
|
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
|
2021-03-30 14:37:36 +02:00
|
|
|
{{- end }}
|
2020-09-11 20:36:58 +02:00
|
|
|
|
2021-03-30 14:37:36 +02:00
|
|
|
{{- $paginator := .Paginate $pages }}
|
2021-02-10 16:47:40 +01:00
|
|
|
|
|
|
|
{{- if and .IsHome .Site.Params.homeInfoParams (eq $paginator.PageNumber 1) }}
|
|
|
|
{{- partial "home_info.html" . }}
|
|
|
|
{{- end }}
|
|
|
|
|
2021-03-30 14:37:36 +02:00
|
|
|
{{- $term := .Data.Term }}
|
2020-03-09 16:56:13 +01:00
|
|
|
{{- range $index, $page := $paginator.Pages }}
|
2019-03-31 14:32:06 +02:00
|
|
|
|
2020-03-09 18:50:02 +01:00
|
|
|
{{- $class := "post-entry" }}
|
2021-02-10 16:28:08 +01:00
|
|
|
|
|
|
|
{{- $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 18:50:02 +01:00
|
|
|
{{- $class = "first-entry" }}
|
2020-10-10 16:04:13 +02:00
|
|
|
{{- else if $term }}
|
2020-03-09 18:50:02 +01:00
|
|
|
{{- $class = "post-entry tag-entry" }}
|
2020-03-09 16:56:13 +01:00
|
|
|
{{- end }}
|
2021-02-10 16:28:08 +01:00
|
|
|
|
2020-03-09 18:50:02 +01:00
|
|
|
<article class="{{ $class }}">
|
2021-03-30 14:37:36 +02:00
|
|
|
{{- $isHidden := (.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInList) }}
|
2020-12-29 12:14:03 +01:00
|
|
|
{{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }}
|
2019-03-31 14:32:06 +02:00
|
|
|
<header class="entry-header">
|
2020-07-24 17:16:33 +02:00
|
|
|
<h2>
|
2021-03-30 14:37:36 +02:00
|
|
|
{{- .Title }}
|
|
|
|
{{- if .Draft }}<div class="entry-isdraft"><sup> [draft]</sup></div>{{ end -}}
|
2020-07-24 17:16:33 +02:00
|
|
|
</h2>
|
2018-01-08 17:28:39 +01:00
|
|
|
</header>
|
2021-03-30 14:37:36 +02:00
|
|
|
{{- if (ne (.Param "hideSummary") true) }}
|
2019-03-31 14:32:06 +02:00
|
|
|
<section class="entry-content">
|
2021-03-30 14:37:36 +02:00
|
|
|
<p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p>
|
2019-03-31 14:32:06 +02:00
|
|
|
</section>
|
2020-09-23 09:22:32 +02:00
|
|
|
{{- end }}
|
2021-01-24 13:35:00 +01:00
|
|
|
{{- if not (.Param "hideMeta") }}
|
2019-03-31 14:32:06 +02:00
|
|
|
<footer class="entry-footer">
|
2020-10-20 15:08:29 +02:00
|
|
|
{{- partial "post_meta.html" . -}}
|
2018-01-08 17:28:39 +01:00
|
|
|
</footer>
|
2021-01-24 13:35:00 +01:00
|
|
|
{{- end }}
|
2020-09-06 18:16:58 +02:00
|
|
|
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
|
2018-01-08 17:28:39 +01:00
|
|
|
</article>
|
2020-03-09 16:56:13 +01:00
|
|
|
{{- end }}
|
2019-03-31 14:32:06 +02:00
|
|
|
|
2020-03-09 16:56:13 +01:00
|
|
|
{{- if gt $paginator.TotalPages 1 }}
|
2019-03-31 14:32:06 +02:00
|
|
|
<footer class="page-footer">
|
2018-01-08 17:28:39 +01:00
|
|
|
<nav class="pagination">
|
2020-03-09 16:56:13 +01:00
|
|
|
{{- if $paginator.HasPrev }}
|
2020-12-05 15:42:55 +01:00
|
|
|
<a class="prev" href="{{ $paginator.Prev.URL | absURL }}">« {{ i18n "prev_page" }}</a>
|
2020-03-09 16:56:13 +01:00
|
|
|
{{- end }}
|
|
|
|
{{- if $paginator.HasNext }}
|
2020-12-05 15:42:55 +01:00
|
|
|
<a class="next" href="{{ $paginator.Next.URL | absURL }}">{{ i18n "next_page" }} »</a>
|
2020-03-09 16:56:13 +01:00
|
|
|
{{- end }}
|
2018-01-08 17:28:39 +01:00
|
|
|
</nav>
|
|
|
|
</footer>
|
2020-03-09 16:56:13 +01:00
|
|
|
{{- end }}
|
2021-03-30 14:37:36 +02:00
|
|
|
|
|
|
|
{{- end }}{{/* end profileMode */}}
|
|
|
|
|
2021-02-10 16:28:08 +01:00
|
|
|
{{- end }}{{- /* end main */ -}}
|