Skip to content
This repository was archived by the owner on Jul 21, 2019. It is now read-only.

Commit 3cbf1a6

Browse files
Make speaker attributes optionally verbose
1 parent 8857572 commit 3cbf1a6

2 files changed

Lines changed: 62 additions & 32 deletions

File tree

layouts/speaker/single.html

Lines changed: 54 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,6 @@ <h2 class="speaker-page">{{ .Title }}</h2>
1111
<div class = "col-md-4 offset-md-1">
1212
<span class="speaker-page content-text">
1313
{{ .Content }}
14-
{{- if isset .Params "pronouns" -}}
15-
{{- if ne .Params.pronouns "" -}}
16-
My pronouns are {{ .Params.pronouns }}<br />
17-
{{- end -}}
18-
{{- end -}}
19-
{{- if isset .Params "twitter" -}}
20-
{{- if ne .Params.twitter "" -}}
21-
<a href = "https://twitter.com/{{ .Params.twitter }}"><i class="fa fa-twitter fa-2x" aria-hidden="true"></i></a>&nbsp;
22-
{{- end -}}
23-
{{- end -}}
24-
{{- if isset .Params "website" -}}
25-
{{- if ne .Params.website "" -}}
26-
<a href = "{{ .Params.website }}"><i class="fa fa-home fa-2x" aria-hidden="true"></i></a>&nbsp;
27-
{{- end -}}
28-
{{- end -}}
29-
{{- if isset .Params "facebook" -}}
30-
{{- if ne .Params.facebook "" -}}
31-
<a href = "{{ .Params.facebook }}"><i class="fa fa-facebook-official fa-2x" aria-hidden="true"></i></a>&nbsp;
32-
{{- end -}}
33-
{{- end -}}
34-
{{- if isset .Params "linkedin" -}}
35-
{{- if ne .Params.linkedin "" -}}
36-
<a href = "{{ .Params.linkedin }}"><i class="fa fa-linkedin fa-2x" aria-hidden="true"></i></a>&nbsp;
37-
{{- end -}}
38-
{{- end -}}
39-
{{- if isset .Params "github" -}}
40-
{{- if ne .Params.github "" -}}
41-
<a href = "https://github.com/{{ .Params.github }}"><i class="fa fa-github fa-2x" aria-hidden="true"></i></a>&nbsp;
42-
{{- end -}}
43-
{{- end -}}
4414
</span>
4515
<div class="speaker-bio-talks">
4616
<h3>{{ .Title }} at {{ $e.city }} {{$e.year}}</h3>
@@ -73,6 +43,60 @@ <h3>{{ .Title }} at {{ $e.city }} {{$e.year}}</h3>
7343
{{- else -}}
7444
<img src = {{ "img/speaker-default.jpg" | absURL }} class="img-fluid" alt="{{ .Title }}"/><br />
7545
{{- end -}}
46+
{{- if isset .Params "twitter" -}}
47+
{{- if ne .Params.twitter "" -}}
48+
<a href = "https://twitter.com/{{ .Params.twitter }}"><i class="fa fa-twitter fa-2x" aria-hidden="true"></i>
49+
{{- if $e.speakers_verbose -}}
50+
@{{ .Params.twitter }}<br />
51+
{{- end -}}
52+
</a>
53+
{{- end -}}
54+
{{- end -}}
55+
{{- if isset .Params "website" -}}
56+
{{- if ne .Params.website "" -}}
57+
<a href = "{{ .Params.website }}"><i class="fa fa-home fa-2x" aria-hidden="true"></i>&nbsp;
58+
{{- if $e.speakers_verbose -}}
59+
{{ .Params.website }}<br />
60+
{{- end -}}
61+
</a>
62+
{{- end -}}
63+
{{- end -}}
64+
{{- if isset .Params "facebook" -}}
65+
{{- if ne .Params.facebook "" -}}
66+
<a href = "{{ .Params.facebook }}"><i class="fa fa-facebook-official fa-2x" aria-hidden="true"></i>&nbsp;
67+
{{- if $e.speakers_verbose -}}
68+
{{ .Params.facebook }}<br />
69+
{{- end -}}
70+
</a>
71+
{{- end -}}
72+
{{- end -}}
73+
{{- if isset .Params "linkedin" -}}
74+
{{- if ne .Params.linkedin "" -}}
75+
<a href = "{{ .Params.linkedin }}"><i class="fa fa-linkedin fa-2x" aria-hidden="true"></i>&nbsp;
76+
{{- if $e.speakers_verbose -}}
77+
{{ .Params.linkedin }}<br />
78+
{{- end -}}
79+
</a>
80+
{{- end -}}
81+
{{- end -}}
82+
{{- if isset .Params "github" -}}
83+
{{- if ne .Params.github "" -}}
84+
<a href = "https://github.com/{{ .Params.github }}"><i class="fa fa-github fa-2x" aria-hidden="true"></i>&nbsp;
85+
{{- if $e.speakers_verbose -}}
86+
{{ .Params.github }}<br />
87+
{{- end -}}
88+
</a>
89+
{{- end -}}
90+
{{- end -}}
91+
{{- if isset .Params "pronouns" -}}
92+
{{- if ne .Params.pronouns "" -}}
93+
<a href = "https://pronoun.is/{{ .Params.pronouns }}"><i class="fa fa-user fa-2x" aria-hidden="true"></i>&nbsp;
94+
{{- if $e.speakers_verbose -}}
95+
{{ .Params.pronouns }}<br />
96+
{{- end -}}
97+
</a>
98+
{{- end -}}
99+
{{- end -}}
76100
</div>
77101
</div>
78102
{{ partial "sponsors.html" . }}

layouts/talk/single.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,16 @@ <h4 class="talk-page"><a href = "{{ (printf "events/%s/speakers/%s" $e.name ($.S
128128
</a></h4>
129129
{{- if isset .Params "twitter" -}}
130130
{{- if ne .Params.twitter "" -}}
131-
<a href = "https://twitter.com/{{ .Params.twitter }}"><i class="fa fa-twitter fa-2x" aria-hidden="true"></i></a>&nbsp;
131+
<a href = "https://twitter.com/{{ .Params.twitter }}"><i class="fa fa-twitter fa-2x" aria-hidden="true"></i></a><br />
132132
{{- end -}}
133133
{{- end -}}
134-
<span class="talk-page content-text">{{ .Content }}</span>
134+
<span class="talk-page content-text">
135+
{{- if ge (countrunes .Content ) 200 -}}
136+
{{ .Content | markdownify | truncate 200 " "}}<a href = "{{ .Permalink | absURL }}">...</a>
137+
{{- else -}}
138+
{{ .Content | markdownify }}
139+
{{- end -}}
140+
</span>
135141
{{- end -}}
136142

137143
{{- end -}}

0 commit comments

Comments
 (0)