2020-09-23 12:52:32 +05:30
|
|
|
{{- define "main" }}
|
2019-03-31 20:32:06 +08:00
|
|
|
|
2022-03-27 18:44:06 +05:30
|
|
|
{{- if (and site.Params.profileMode.enabled .IsHome) }}
|
2020-09-23 18:23:57 +05:30
|
|
|
{{- partial "index_profile.html" . }}
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- else }} {{/* if not profileMode */}}
|
2020-08-27 19:37:45 +05:30
|
|
|
|
2020-09-11 20:36:58 +02:00
|
|
|
{{- if not .IsHome | and .Title }}
|
2020-08-27 19:37:45 +05:30
|
|
|
<header class="page-header">
|
2021-02-08 20:30:34 +05:30
|
|
|
{{- partial "breadcrumbs.html" . }}
|
2020-08-27 19:37:45 +05:30
|
|
|
<h1>{{ .Title }}</h1>
|
2021-01-27 21:19:21 +05:30
|
|
|
{{- if .Description }}
|
|
|
|
<div class="post-description">
|
2021-09-02 13:36:33 +05:30
|
|
|
{{ .Description | markdownify }}
|
2021-01-27 21:19:21 +05:30
|
|
|
</div>
|
|
|
|
{{- end }}
|
2020-08-27 19:37:45 +05:30
|
|
|
</header>
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- end }}
|
2020-09-19 17:29:05 +05:30
|
|
|
|
2021-09-02 13:43:08 +05:30
|
|
|
{{- if .Content }}
|
2021-09-02 13:33:47 +05:30
|
|
|
<div class="post-content">
|
|
|
|
{{- if not (.Param "disableAnchoredHeadings") }}
|
|
|
|
{{- partial "anchored_headings.html" .Content -}}
|
|
|
|
{{- else }}{{ .Content }}{{ end }}
|
|
|
|
</div>
|
2021-09-02 13:43:08 +05:30
|
|
|
{{- end }}
|
2021-09-02 13:33:47 +05:30
|
|
|
|
2020-10-13 18:17:39 +05:30
|
|
|
{{- $pages := union .RegularPages .Sections }}
|
2020-09-11 20:36:58 +02:00
|
|
|
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- if .IsHome }}
|
|
|
|
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
|
2021-03-30 18:07:36 +05:30
|
|
|
{{- end }}
|
2020-09-11 20:36:58 +02:00
|
|
|
|
2021-03-30 18:07:36 +05:30
|
|
|
{{- $paginator := .Paginate $pages }}
|
2021-02-10 21:17:40 +05:30
|
|
|
|
2022-03-27 18:44:06 +05:30
|
|
|
{{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }}
|
2021-02-10 21:17:40 +05:30
|
|
|
{{- partial "home_info.html" . }}
|
|
|
|
{{- end }}
|
|
|
|
|
2021-03-30 18:07:36 +05:30
|
|
|
{{- $term := .Data.Term }}
|
2020-03-09 23:56:13 +08:00
|
|
|
{{- range $index, $page := $paginator.Pages }}
|
2019-03-31 20:32:06 +08:00
|
|
|
|
2020-03-10 01:50:02 +08:00
|
|
|
{{- $class := "post-entry" }}
|
2021-02-10 20:58:08 +05:30
|
|
|
|
2022-03-27 18:44:06 +05:30
|
|
|
{{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }}
|
2021-02-10 20:58:08 +05:30
|
|
|
{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }}
|
2020-03-10 01:50:02 +08:00
|
|
|
{{- $class = "first-entry" }}
|
2020-10-10 19:34:13 +05:30
|
|
|
{{- else if $term }}
|
2020-03-10 01:50:02 +08:00
|
|
|
{{- $class = "post-entry tag-entry" }}
|
2020-03-09 23:56:13 +08:00
|
|
|
{{- end }}
|
2021-02-10 20:58:08 +05:30
|
|
|
|
2020-03-10 01:50:02 +08:00
|
|
|
<article class="{{ $class }}">
|
2022-03-27 18:44:06 +05:30
|
|
|
{{- $isHidden := (site.Params.cover.hidden | default site.Params.cover.hiddenInList) }}
|
2020-12-29 16:44:03 +05:30
|
|
|
{{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }}
|
2019-03-31 20:32:06 +08:00
|
|
|
<header class="entry-header">
|
2020-07-24 20:46:33 +05:30
|
|
|
<h2>
|
2021-03-30 18:07:36 +05:30
|
|
|
{{- .Title }}
|
2021-09-04 12:03:12 +05:30
|
|
|
{{- if .Draft }}<sup><span class="entry-isdraft"> [draft]</span></sup>{{- end }}
|
2020-07-24 20:46:33 +05:30
|
|
|
</h2>
|
2018-01-09 00:28:39 +08:00
|
|
|
</header>
|
2021-03-30 18:07:36 +05:30
|
|
|
{{- if (ne (.Param "hideSummary") true) }}
|
2022-04-19 17:03:05 +02:00
|
|
|
<div class="entry-content">
|
2021-03-30 18:07:36 +05:30
|
|
|
<p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p>
|
2022-04-19 17:03:05 +02:00
|
|
|
</div>
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- end }}
|
2021-01-24 18:05:00 +05:30
|
|
|
{{- if not (.Param "hideMeta") }}
|
2019-03-31 20:32:06 +08:00
|
|
|
<footer class="entry-footer">
|
2020-10-20 18:38:29 +05:30
|
|
|
{{- partial "post_meta.html" . -}}
|
2018-01-09 00:28:39 +08:00
|
|
|
</footer>
|
2021-01-24 18:05:00 +05:30
|
|
|
{{- end }}
|
2020-09-06 21:46:58 +05:30
|
|
|
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
|
2018-01-09 00:28:39 +08:00
|
|
|
</article>
|
2020-03-09 23:56:13 +08:00
|
|
|
{{- end }}
|
2019-03-31 20:32:06 +08:00
|
|
|
|
2020-03-09 23:56:13 +08:00
|
|
|
{{- if gt $paginator.TotalPages 1 }}
|
2019-03-31 20:32:06 +08:00
|
|
|
<footer class="page-footer">
|
2018-01-09 00:28:39 +08:00
|
|
|
<nav class="pagination">
|
2020-03-09 23:56:13 +08: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 23:56:13 +08: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 23:56:13 +08:00
|
|
|
{{- end }}
|
2018-01-09 00:28:39 +08:00
|
|
|
</nav>
|
|
|
|
</footer>
|
2020-03-09 23:56:13 +08:00
|
|
|
{{- end }}
|
2021-03-30 18:07:36 +05:30
|
|
|
|
|
|
|
{{- end }}{{/* end profileMode */}}
|
|
|
|
|
2021-02-10 20:58:08 +05:30
|
|
|
{{- end }}{{- /* end main */ -}}
|