1
+ {{- define "main" }}
2
+
3
+ {{- if (and site.Params.profileMode.enabled .IsHome) }}
4
+ {{- partial "index_profile.html" . }}
5
+ {{- else }} {{/* if not profileMode */}}
6
+
7
+ {{- if not .IsHome | and .Title }}
8
+ < header class ="page-header ">
9
+ {{- partial "breadcrumbs.html" . }}
10
+ < h1 >
11
+ {{ .Title }}
12
+ {{- if and (or (eq .Kind `term`) (eq .Kind `section`)) (.Param "ShowRssButtonInSectionTermList") }}
13
+ {{- with .OutputFormats.Get "rss" }}
14
+ < a href ="{{ .RelPermalink }} " title ="RSS " aria-label ="RSS ">
15
+ < svg xmlns ="http://www.w3.org/2000/svg " viewBox ="0 0 24 24 " fill ="none " stroke ="currentColor " stroke-width ="2 "
16
+ stroke-linecap ="round " stroke-linejoin ="round " height ="23 ">
17
+ < path d ="M4 11a9 9 0 0 1 9 9 " />
18
+ < path d ="M4 4a16 16 0 0 1 16 16 " />
19
+ < circle cx ="5 " cy ="19 " r ="1 " />
20
+ </ svg >
21
+ </ a >
22
+ {{- end }}
23
+ {{- end }}
24
+ </ h1 >
25
+ {{- if .Description }}
26
+ < div class ="post-description ">
27
+ {{ .Description | markdownify }}
28
+ </ div >
29
+ {{- end }}
30
+ </ header >
31
+ {{- end }}
32
+
33
+ {{- if .Content }}
34
+ < div class ="post-content ">
35
+ {{- if not (.Param "disableAnchoredHeadings") }}
36
+ {{- partial "anchored_headings.html" .Content -}}
37
+ {{- else }}{{ .Content }}{{ end }}
38
+ </ div >
39
+ {{- end }}
40
+
41
+ {{- $pages := union .RegularPages .Sections }}
42
+
43
+ {{- if .IsHome }}
44
+ {{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
45
+ {{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }}
46
+ {{- end }}
47
+
48
+ {{- $paginator := .Paginate $pages }}
49
+
50
+ {{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }}
51
+ {{- partial "home_info.html" . }}
52
+ {{- end }}
53
+
54
+ {{- $term := .Data.Term }}
55
+ {{- range $index, $page := $paginator.Pages }}
56
+
57
+ {{- $class := "post-entry" }}
58
+
59
+ {{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }}
60
+ {{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }}
61
+ {{- $class = "first-entry" }}
62
+ {{- else if $term }}
63
+ {{- $class = "post-entry tag-entry" }}
64
+ {{- end }}
65
+
66
+ {{- if eq $index 5 }}
67
+ < article class ="{{ $class }} ">
68
+ < script async src ="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4739645989170648 "
69
+ crossorigin ="anonymous "> </ script >
70
+ < ins class ="adsbygoogle "
71
+ style ="display:block "
72
+ data-ad-format ="fluid "
73
+ data-ad-layout-key ="-fb+5w+4e-db+86 "
74
+ data-ad-client ="ca-pub-4739645989170648 "
75
+ data-ad-slot ="5450609552 "> </ ins >
76
+ < script >
77
+ ( adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
78
+ </ script >
79
+ </ article >
80
+ {{- end }}
81
+
82
+ < article class ="{{ $class }} ">
83
+ {{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }}
84
+ {{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }}
85
+ < header class ="entry-header ">
86
+ < h2 class ="entry-hint-parent ">
87
+ {{- .Title }}
88
+ {{- if .Draft }}
89
+ < span class ="entry-hint " title ="Draft ">
90
+ < svg xmlns ="http://www.w3.org/2000/svg " height ="20 " viewBox ="0 -960 960 960 " fill ="currentColor ">
91
+ < path
92
+ d ="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z " />
93
+ </ svg >
94
+ </ span >
95
+ {{- end }}
96
+ </ h2 >
97
+ </ header >
98
+ {{- if (ne (.Param "hideSummary") true) }}
99
+ < div class ="entry-content ">
100
+ < p > {{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</ p >
101
+ </ div >
102
+ {{- end }}
103
+ {{- if not (.Param "hideMeta") }}
104
+ < footer class ="entry-footer ">
105
+ {{- partial "post_meta.html" . -}}
106
+ </ footer >
107
+ {{- end }}
108
+ < a class ="entry-link " aria-label ="post link to {{ .Title | plainify }} " href ="{{ .Permalink }} "> </ a >
109
+ </ article >
110
+ {{- end }}
111
+
112
+ {{- if gt $paginator.TotalPages 1 }}
113
+ < footer class ="page-footer ">
114
+ < nav class ="pagination ">
115
+ {{- if $paginator.HasPrev }}
116
+ < a class ="prev " href ="{{ $paginator.Prev.URL | absURL }} ">
117
+ « {{ i18n "prev_page" }}
118
+ {{- if (.Param "ShowPageNums") }}
119
+ {{- sub $paginator.PageNumber 1 }}/{{ $paginator.TotalPages }}
120
+ {{- end }}
121
+ </ a >
122
+ {{- end }}
123
+ {{- if $paginator.HasNext }}
124
+ < a class ="next " href ="{{ $paginator.Next.URL | absURL }} ">
125
+ {{- i18n "next_page" }}
126
+ {{- if (.Param "ShowPageNums") }}
127
+ {{- add 1 $paginator.PageNumber }}/{{ $paginator.TotalPages }}
128
+ {{- end }} »
129
+ </ a >
130
+ {{- end }}
131
+ </ nav >
132
+ </ footer >
133
+ {{- end }}
134
+
135
+ {{- end }}{{/* end profileMode */}}
136
+
137
+ {{- end }}{{- /* end main */ -}}
0 commit comments