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+ < article class ="{{ $class }} ">
67+ {{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }}
68+ {{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }}
69+ < header class ="post-header ">
70+ < h1 class ="post-title entry-hint-parent ">
71+ < a href ="{{ .Permalink }} "> {{ .Title }}</ a >
72+ {{- if .Draft }}
73+ < span class ="entry-hint " title ="Draft ">
74+ < svg xmlns ="http://www.w3.org/2000/svg " height ="35 " viewBox ="0 -960 960 960 " fill ="currentColor ">
75+ < path
76+ 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 " />
77+ </ svg >
78+ </ span >
79+ {{- end }}
80+ </ h1 >
81+ {{- if .Description }}
82+ < div class ="post-description ">
83+ {{ .Description }}
84+ </ div >
85+ {{- end }}
86+ {{- if not (.Param "hideMeta") }}
87+ < div class ="post-meta ">
88+ {{- partial "post_meta.html" . -}}
89+ {{- partial "translation_list.html" . -}}
90+ {{- partial "edit_post.html" . -}}
91+ {{- partial "post_canonical.html" . -}}
92+ </ div >
93+ {{- end }}
94+ </ header >
95+ {{- partial "members.html" . }}
96+
97+ {{- $isHidden := (.Param "cover.hiddenInSingle") | default (.Param "cover.hidden") | default false }}
98+ {{- partial "cover.html" (dict "cxt" . "IsSingle" true "isHidden" $isHidden) }}
99+ {{- if (.Param "ShowToc") }}
100+ {{- partial "toc.html" . }}
101+ {{- end }}
102+
103+ {{- if .Content }}
104+ < div class ="post-content ">
105+ {{- if not (.Param "disableAnchoredHeadings") }}
106+ {{- partial "anchored_headings.html" .Content -}}
107+ {{- else }}in content{{ .Content }}{{ end }}
108+ </ div >
109+ {{- end }}
110+
111+ < footer class ="post-footer ">
112+ {{- $tags := .Language.Params.Taxonomies.tag | default "tags" }}
113+ < ul class ="post-tags ">
114+ {{- range ($.GetTerms $tags) }}
115+ < li > < a href ="{{ .Permalink }} "> {{ .LinkTitle }}</ a > </ li >
116+ {{- end }}
117+ </ ul >
118+ {{- if (.Param "ShowPostNavLinks") }}
119+ {{- partial "post_nav_links.html" . }}
120+ {{- end }}
121+ </ footer >
122+
123+ {{- if (.Param "comments") }}
124+ {{- partial "comments.html" . }}
125+ {{- end }}
126+ </ article >
127+ {{- end }}
128+
129+ {{- if gt $paginator.TotalPages 1 }}
130+ < footer class ="page-footer ">
131+ < nav class ="pagination ">
132+ {{- if $paginator.HasPrev }}
133+ < a class ="prev " href ="{{ $paginator.Prev.URL | absURL }} ">
134+ « {{ i18n "prev_page" }}
135+ {{- if (.Param "ShowPageNums") }}
136+ {{- sub $paginator.PageNumber 1 }}/{{ $paginator.TotalPages }}
137+ {{- end }}
138+ </ a >
139+ {{- end }}
140+ {{- if $paginator.HasNext }}
141+ < a class ="next " href ="{{ $paginator.Next.URL | absURL }} ">
142+ {{- i18n "next_page" }}
143+ {{- if (.Param "ShowPageNums") }}
144+ {{- add 1 $paginator.PageNumber }}/{{ $paginator.TotalPages }}
145+ {{- end }} »
146+ </ a >
147+ {{- end }}
148+ </ nav >
149+ </ footer >
150+ {{- end }}
151+
152+ {{- end }}{{/* end profileMode */}}
153+
154+ {{- end }}{{- /* end main */ -}}
0 commit comments