5
5
{{ partial "search/widget" . }}
6
6
{{- $introDescription := $s.introDescription }}
7
7
{{- with .Params.introDescription }}
8
- {{- $introDescription = . }}
8
+ {{- $introDescription = . }}
9
9
{{- end }}
10
10
{{- if $introDescription }}
11
- {{- $author := $s.Author }}
12
- {{- $showAuthorPhoto := false }}
13
- {{- $fullAuthor := reflect.IsMap $author }}
14
- {{- if $fullAuthor }}
15
- {{- if $author.photo }}
16
- {{- $showAuthorPhoto = true }}
17
- {{- end }}
18
- {{- end }}
19
- {{- if $showAuthorPhoto }}
20
- < div class ="author_header ">
21
- < img src ="{{ relURL $author.photo }} " alt ="{{ $author.name }} photo ">
22
- < h2 > {{ $author.name }}</ h2 >
23
- </ div >
24
- {{- else }}
25
- < h2 > {{ if $fullAuthor }}{{ $author.name }}{{ else }}{{ $author }}{{ end }}</ h2 >
26
- {{- end }}
27
- < div class ="author_bio ">
28
- {{ markdownify $introDescription }}
29
- </ div >
30
- {{- if ( ne $s.introURL false ) }}
31
- {{- $r := T "read_more" }}
32
- < a href ='{{ relLangURL (default "about/" $s.introURL) }} ' class ="button mt-1 " role ="button " title ='{{ $r }} '> {{ $r }}</ a >
33
- {{- end }}
11
+ {{- $author := $s.Author }}
12
+ {{- $showAuthorPhoto := false }}
13
+ {{- $fullAuthor := reflect.IsMap $author }}
14
+ {{- if $fullAuthor }}
15
+ {{- if $author.photo }}
16
+ {{- $showAuthorPhoto = true }}
17
+ {{- end }}
18
+ {{- end }}
19
+ {{- if $showAuthorPhoto }}
20
+ < div class ="author_header ">
21
+ < img src ="{{ relURL $author.photo }} " alt ="{{ $author.name }} photo ">
22
+ < h2 > {{ $author.name }}</ h2 >
23
+ </ div >
24
+ {{- else }}
25
+ < h2 > {{ if $fullAuthor }}{{ $author.name }}{{ else }}{{ $author }}{{ end }}</ h2 >
26
+ {{- end }}
27
+ < div class ="author_bio ">
28
+ {{ markdownify $introDescription }}
29
+ </ div >
30
+ {{- if ( ne $s.introURL false ) }}
31
+ {{- $r := T "read_more" }}
32
+ < a href ='{{ relLangURL (default "about/" $s.introURL) }} ' class ="button mt-1 " role ="button " title ='{{ $r }} '> {{ $r
33
+ }}</ a >
34
+ {{- end }}
34
35
{{- end }}
35
36
36
37
{{ if .Site.Params.sidebardisclaimer }}
37
- < div class ="sidebardisclaimer ">
38
- < h2 class ="mt-4 "> Disclaimer</ h2 >
39
- {{ .Site.Params.disclaimerText }}
40
- </ div >
38
+ < div class ="sidebardisclaimer ">
39
+ < h2 class ="mt-4 "> Disclaimer</ h2 >
40
+ {{ .Site.Params.disclaimerText }}
41
+ </ div >
41
42
{{ end }}
42
43
43
44
{{- $relatedInSidebar := true }}
44
45
{{- if eq $s.showRelatedInSidebar false }}
45
- {{ $relatedInSidebar = false }}
46
+ {{ $relatedInSidebar = false }}
46
47
{{- end }}
47
48
{{ if (and ($relatedInSidebar) (isset .Params "series") ) }}
48
- {{$related := where .Site.RegularPages ".Params.series" "eq" .Params.series }}
49
- < h2 class ="mt-4 "> {{ T "series_posts" }}</ h2 >
50
- < ul >
51
- {{ range $related }}
52
- < li >
53
- < a href ="{{ .RelPermalink }} " class ="nav-link " title ="{{ .Title }} "> {{ .Title | markdownify }}</ a >
54
- </ li >
55
- {{ end }}
56
- </ ul >
49
+ {{$related := where .Site.RegularPages ".Params.series" "eq" .Params.series }}
50
+ < h2 class ="mt-4 "> {{ T "series_posts" }}</ h2 >
51
+ < ul >
52
+ {{ range $related }}
53
+ < li >
54
+ < a href ="{{ .RelPermalink }} " class ="nav-link " title ="{{ .Title }} "> {{ .Title | markdownify }}</ a >
55
+ </ li >
56
+ {{ end }}
57
+ </ ul >
57
58
{{ end }}
58
59
59
60
{{- $posts := where .Site.RegularPages "Type" "in" $s.mainSections }}
60
61
{{- $featured := default 8 $s.numberOfFeaturedPosts }}
61
62
{{- $featuredPosts := first $featured (where $posts "Params.featured" true)}}
62
63
{{- with $featuredPosts }}
63
64
< h2 class ="mt-4 "> {{ T "featured_posts" }}</ h2 >
64
- < ul >
65
+ < ul class =" sidebar_list " >
65
66
{{- range . }}
66
67
< li >
68
+ < img class ="icon " src ="/icons/book.svg " alt ="Post Icon ">
67
69
< a href ="{{ .RelPermalink }} " class ="nav-link " title ="{{ .Title }} "> {{ .Title | markdownify }}</ a >
68
70
</ li >
69
71
{{- end }}
70
72
</ ul >
71
73
{{- end }}
74
+
75
+ < h2 class ="mt-4 "> Upcoming Events</ h2 >
76
+ < ul class ="event_list " style ="list-style-type: none; ">
77
+ {{- $allEvents := site.Taxonomies.tags.event }}
78
+ {{- $upcomingEvents := slice }}
79
+
80
+ {{- range $allEvents }}
81
+ {{- if .Params.event_date }}
82
+ {{- $eventTime := .Params.event_date | time }}
83
+ {{- if gt $eventTime time.Now }}
84
+ {{- $upcomingEvents = $upcomingEvents | append . }}
85
+ {{- end }}
86
+ {{- end }}
87
+ {{- end }}
88
+
89
+ {{- range first 5 $upcomingEvents }}
90
+ {{- $isMeetup := false }}
91
+ {{- range .Params.tags }}
92
+ {{- if eq . "meetup" }}
93
+ {{- $isMeetup = true }}
94
+ {{- end }}
95
+ {{- end }}
96
+ < li {{ if $isMeetup }} class ="meetup " {{ end }} >
97
+ < img class ="icon " {{ if $isMeetup }} src ="/icons/group.svg " alt ="Meetup Icon " {{else}} src ="/icons/calendar.svg "
98
+ alt ="Event Icon " {{ end }} >
99
+ < a href ="{{ .RelPermalink }} " class ="nav-link " title ="{{ .Title }} ">
100
+ {{ .Title | markdownify }}
101
+ {{ if .Params.event_date }} ({{ time.Format "Jan 2006" .Params.event_date }}){{ end }}
102
+ </ a >
103
+ </ li >
104
+ {{- end }}
105
+ </ ul >
106
+
72
107
< h2 class ="mt-4 "> {{ T "recent_posts" }}</ h2 >
73
- < ul class ="flex-column ">
108
+ < ul class ="sidebar_list " style =" list-style-type: none; ">
74
109
{{- $recent := default 8 $s.numberOfRecentPosts }}
75
110
{{- range first $recent ($posts | complement $featuredPosts) }}
76
111
< li >
112
+ < img class ="icon " src ="/icons/book.svg " alt ="Post Icon ">
77
113
< a href ="{{ .RelPermalink }} " class ="nav-link " title ="{{ .Title }} "> {{ .Title | markdownify }}</ a >
78
114
</ li >
79
115
{{- end }}
80
116
</ ul >
81
117
82
- < h2 class ="mt-4 "> Meetups</ h2 >
83
- < ul class ="flex-column ">
84
- {{- range first 3 (site.Taxonomies.tags.Get "meetup") }}
85
- < li >
118
+ < h2 class ="mt-4 "> Past Events</ h2 >
119
+ < ul class ="event_list " style ="list-style-type: none; ">
120
+ {{- $allEvents := site.Taxonomies.tags.event }}
121
+ {{- $pastEvents := slice }}
122
+
123
+ {{- range $allEvents }}
124
+ {{- if .Params.event_date }}
125
+ {{- $eventTime := .Params.event_date | time }}
126
+ {{- if lt $eventTime time.Now }}
127
+ {{- $pastEvents = $pastEvents | append . }}
128
+ {{- end }}
129
+ {{- end }}
130
+ {{- end }}
131
+
132
+ {{- range first 3 $pastEvents }}
133
+ {{- $isMeetup := false }}
134
+ {{- range .Params.tags }}
135
+ {{- if eq . "meetup" }}
136
+ {{- $isMeetup = true }}
137
+ {{- end }}
138
+ {{- end }}
139
+ < li {{ if $isMeetup }} class ="meetup " {{ end }} >
140
+ < img class ="icon " {{ if $isMeetup }} src ="/icons/group.svg " alt ="Meetup Icon " {{else}} src ="/icons/calendar.svg "
141
+ alt ="Event Icon " {{ end }} >
86
142
< a href ="{{ .RelPermalink }} " class ="nav-link " title ="{{ .Title }} ">
87
-
88
- {{ if .Params.meetup_date }}
89
- {{ $meetupTime := .Params.meetup_date | time }}
90
- {{ if lt time.Now $meetupTime }}< b > [Upcoming]</ b > {{end}}
91
- {{ end}}
92
- {{ .Title | markdownify }} {{ if .Params.meetup_date }} ({{ time.Format "Jan 2006" .Params.meetup_date }}){{ end }}
143
+ {{ .Title | markdownify }}
144
+ {{ if .Params.event_date }} ({{ time.Format "Jan 2006" .Params.event_date }}){{ end }}
93
145
</ a >
94
146
</ li >
95
147
{{- end }}
96
148
</ ul >
149
+
97
150
< p > < a href ='{{ ref . "/tags/meetup" }} '> Browse all meetups.</ a > </ p >
98
151
99
152
{{- $tagsLimit := (default 100 $s.numberOfTagsShown) }}
@@ -105,7 +158,8 @@ <h2 class="mt-4 taxonomy" id="{{ $key }}-section">{{ T $key }}</h2>
105
158
{{- $onPageTags := $.Page.Params.tags }}
106
159
{{- $slicedTags := ($value.ByCount | first $tagsLimit) }}
107
160
{{- range $slicedTags }}
108
- < a href ='{{ relLangURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/ ' class ="post_tag button button_translucent " title ="{{ .Name }} ">
161
+ < a href ='{{ relLangURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/ '
162
+ class ="post_tag button button_translucent " title ="{{ .Name }} ">
109
163
{{ .Name }}
110
164
< span class ="button_tally "> {{ .Count }}</ span >
111
165
</ a >
@@ -118,16 +172,18 @@ <h2 class="mt-4 taxonomy" id="{{ $key }}-section">{{ T $key }}</h2>
118
172
< div class ="tags_list ">
119
173
{{- range $value.Alphabetical }}
120
174
{{ $tagsInfo.Add "tagsInfo" (slice .Name .Count)}}
121
- < a href ='{{ relLangURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/ ' class =" post_tag button button_translucent " data-position ={{ .Count }} title ="{{ .Name }} ">
175
+ < a href ='{{ relLangURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/ '
176
+ class =" post_tag button button_translucent " data-position ={{ .Count }} title ="{{ .Name }} ">
122
177
{{- .Name -}}
123
178
< span class ="button_tally "> {{ .Count }}</ span >
124
179
</ a >
125
180
{{ end }}
126
- < div class ="tags_sort "> < span title ="sort alphabetically "> [A~Z]</ span > < span title ="sort by count "> [0~9]</ span >
181
+ < div class ="tags_sort "> < span title ="sort alphabetically "> [A~Z]</ span > < span
182
+ title ="sort by count "> [0~9]</ span >
127
183
</ div >
128
184
< span class ="tags_hide "> < svg class ="icon ">
129
- < use xlink:href ="#closeme "> </ use >
130
- </ svg > </ span >
185
+ < use xlink:href ="#closeme "> </ use >
186
+ </ svg > </ span >
131
187
</ div >
132
188
</ div >
133
189
{{- end }}
@@ -139,17 +195,17 @@ <h2 class="mt-4 taxonomy" id="{{ $key }}-section">{{ T $key }}</h2>
139
195
< div class ="subscribe ">
140
196
< h2 > Subscribe via RSS</ h2 >
141
197
< ul >
142
- {{/* provide an RSS link for each section */}}
143
- {{- range .Site.Sections -}}
198
+ {{/* provide an RSS link for each section */}}
199
+ {{- range .Site.Sections -}}
144
200
{{- $sectionTitle := .Title -}}
145
201
{{- with .OutputFormats.Get "rss" -}}
146
- < li > < a href ="{{ .RelPermalink }} "> {{ $sectionTitle }}</ a > </ li >
202
+ < li > < a href ="{{ .RelPermalink }} "> {{ $sectionTitle }}</ a > </ li >
203
+ {{- end -}}
204
+ {{- end -}}
205
+ {{- with .Site.Home.OutputFormats.Get "rss" -}}
206
+ < li > < a href ="{{ .RelPermalink }} "> All site content</ a > </ li >
147
207
{{- end -}}
148
- {{- end -}}
149
- {{- with .Site.Home.OutputFormats.Get "rss" -}}
150
- < li > < a href ="{{ .RelPermalink }} "> All site content</ a > </ li >
151
- {{- end -}}
152
208
</ ul >
153
209
</ div >
154
210
</ section >
155
- </ aside >
211
+ </ aside >
0 commit comments