1
1
{{ $ctx := .context | default . }}
2
2
{{ $type := .type | default "general" }}
3
- < ul class ="mb-4 ">
4
- {{ if $ctx.Params.author }}
5
- < li class ="mr-4 inline-block ">
6
- {{ partial "icon.html" (dict "style" "regular" "name" "circle-user" "class" "mr-2") }}
7
- {{ if eq $type "event" }}
8
- {{ partial "components/author-links.html" $ctx }}
9
- {{ else }}
10
- {{ partial "components/author-links.html" $ctx }}
3
+
4
+ {{ $hasInfo := or $ctx.Params.author $ctx.Date }}
5
+ {{ $hasButtons := false }}
6
+ {{ if eq $type "event" }}
7
+ {{ $hasButtons = or $ctx.Params.speaker_slides $ctx.Params.speaker_notebook $ctx.Params.speaker_code $ctx.Params.video $ctx.Params.upcoming }}
8
+ {{ end }}
9
+
10
+ {{ if or $hasInfo $hasButtons }}
11
+ < div class ="metadata-container flex flex-wrap items-center justify-between gap-x-6 gap-y-3 mb-6 py-0 ">
12
+
13
+ <!-- Left side: Info (Author, Date) -->
14
+ < div class ="info-items flex flex-wrap items-center gap-x-5 gap-y-2 text-sm text-gray-600 dark:text-gray-400 ">
15
+
16
+ {{ if $ctx.Params.author }}
17
+ < div class ="author-item flex items-center ">
18
+ {{ partial "icon.html" (dict "style" "regular" "name" "circle-user" "class" "mr-2") }}
19
+ < span > By {{ partial "components/author-links.html" $ctx }}</ span >
20
+ </ div >
11
21
{{ end }}
12
- </ li >
13
- {{ end }}
14
- {{ if $ctx.Date }}
15
- < li class ="mr-4 inline-block ">
16
- {{ partial "icon.html" (dict "style" "regular" "name" "clock" "class" "mr-2") }}
17
- {{ $ctx.Date.Format (site.Params.dateFormatSingle | default "January 2, 2006") }}
18
- {{ if eq $type "event" }}
19
- {{ if $ctx.Params.start_time }}
20
- {{ $ctx.Params.start_time }}{{ if $ctx.Params.end_time }} - {{ $ctx.Params.end_time }}{{ end }} {{ $ctx.Params.time_zone }}
21
- {{ end }}
22
- {{ else if ne $ctx.Params.Lastmod $ctx.Params.Date }}
23
- (Updated {{ $ctx.Params.Lastmod.Format (site.Params.dateFormatSingle | default "January 2, 2006") }})
22
+
23
+ {{ if $ctx.Date }}
24
+ < div class ="date-item flex items-center ">
25
+ {{ partial "icon.html" (dict "style" "regular" "name" "calendar" "class" "mr-2") }}
26
+ < span >
27
+ {{- $ctx.Date.Format (site.Params.dateFormatSingle | default "January 2, 2006") -}}
28
+
29
+ {{- /* Show time for UPCOMING events */ -}}
30
+ {{- if and $ctx.Params.upcoming $ctx.Params.start_time -}}
31
+ < span class ="mx-1 text-gray-400 "> ·</ span >
32
+ {{- $ctx.Params.start_time }}{{ if $ctx.Params.end_time }} - {{ $ctx.Params.end_time }}{{ end }} {{ $ctx.Params.time_zone -}}
33
+ {{- end -}}
34
+
35
+ {{- /* Show 'Updated' for non-events (like blog posts) */ -}}
36
+ {{- if and (ne $type "event") (ne $ctx.Lastmod $ctx.Date) -}}
37
+ < span class ="italic text-gray-500 ml-2 "> (Updated {{ $ctx.Lastmod.Format (site.Params.dateFormatSingle | default "January 2, 2006") }})</ span >
38
+ {{- end -}}
39
+ </ span >
40
+ </ div >
24
41
{{ end }}
25
- </ li >
26
- {{ end }}
27
- {{ if eq $type "event" }}
28
- < li class ="mr-4 inline-block ">
29
- {{ $slides := $ctx.Params.speaker_slides }}{{ if $slides }}< a href ="{{ $slides }} " target ="_blank " class ="ms-1 btn btn-new-primary btn-sm "> {{ partial "icon.html" (dict "style" "regular" "name" "images" "class" "mr-2") }}Slides</ a > {{ end }}
30
- {{ $notebook := $ctx.Params.speaker_notebook }}{{ if $notebook }}< a href ="{{ $notebook }} " target ="_blank " class ="ms-1 btn btn-new-primary btn-sm "> {{ partial "icon.html" (dict "style" "regular" "name" "folder" "class" "mr-2") }}Notebook</ a > {{ end }}
31
- {{ $code := $ctx.Params.speaker_code }}{{ if $code }}< a href ="{{ $code }} " target ="_blank " class ="ms-1 btn btn-new-primary btn-sm "> {{ partial "icon.html" (dict "style" "brands" "name" "github" "class" "mr-2") }}Code</ a > {{ end }}
32
- {{ if $ctx.Params.upcoming }}{{ if $ctx.Params.upcoming_url }}< a href ="{{ $ctx.Params.upcoming_url }} " target ="_blank " class ="ms-1 btn btn-new-primary btn-sm "> {{ partial "icon.html" (dict "style" "regular" "name" "calendar" "class" "mr-2") }}Event</ a > {{ else }}< a href ="https://www.youtube.com/@openneuromorphic " target ="_blank " class ="ms-1 btn btn-new-primary btn-sm "> {{ partial "icon.html" (dict "style" "brands" "name" "youtube" "class" "mr-2") }}Event</ a > {{ end }}{{ end }}
33
- </ li >
42
+
43
+ </ div >
44
+
45
+ <!-- Right side: Action Buttons -->
46
+ {{ if $hasButtons }}
47
+ < div class ="action-buttons flex flex-wrap gap-2 ">
48
+ {{ with $ctx.Params.speaker_slides }}< a href ="{{ . }} " target ="_blank " rel ="noopener " class ="btn btn-sm btn-outline-primary "> {{ partial "icon.html" (dict "style" "regular" "name" "images" "class" "mr-1.5") }}Slides</ a > {{ end }}
49
+ {{ with $ctx.Params.speaker_notebook }}< a href ="{{ . }} " target ="_blank " rel ="noopener " class ="btn btn-sm btn-outline-primary "> {{ partial "icon.html" (dict "style" "regular" "name" "folder" "class" "mr-1.5") }}Notebook</ a > {{ end }}
50
+ {{ with $ctx.Params.speaker_code }}< a href ="{{ . }} " target ="_blank " rel ="noopener " class ="btn btn-sm btn-outline-primary "> {{ partial "icon.html" (dict "style" "brands" "name" "github" "class" "mr-1.5") }}Code</ a > {{ end }}
51
+
52
+ {{ if $ctx.Params.upcoming }}
53
+ {{ $event_url := $ctx.Params.upcoming_url | default "https://www.youtube.com/@openneuromorphic" }}
54
+ < a href ="{{ $event_url }} " target ="_blank " rel ="noopener " class ="btn btn-sm btn-new-primary "> {{ partial "icon.html" (dict "style" "regular" "name" "calendar" "class" "mr-1.5") }}Event Link</ a >
55
+ {{ else if $ctx.Params.video }}
56
+ < a href ="https://www.youtube.com/watch?v={{ $ctx.Params.video }} " target ="_blank " rel ="noopener " class ="btn btn-sm btn-new-primary "> {{ partial "icon.html" (dict "style" "brands" "name" "youtube" "class" "mr-1.5") }}Watch on YouTube</ a >
57
+ {{ end }}
58
+ </ div >
34
59
{{ end }}
35
- </ ul >
60
+
61
+ </ div >
62
+ {{ end }}
0 commit comments