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