|
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 }} |
11 |
| - {{ 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 }} |
| 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 border-y border-border dark:border-darkmode-border py-3"> |
| 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> |
21 | 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.Date $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 |
| - {{ $hasButtons := or $ctx.Params.speaker_slides $ctx.Params.speaker_notebook $ctx.Params.speaker_code $ctx.Params.video $ctx.Params.upcoming }} |
| 42 | + |
| 43 | + </div> |
| 44 | + |
| 45 | + <!-- Right side: Action Buttons --> |
29 | 46 | {{ if $hasButtons }}
|
30 |
| - <li class="mr-4 inline-block"> |
31 |
| - <div class="flex flex-wrap gap-2"> |
32 |
| - {{ with $ctx.Params.speaker_slides }}<a href="{{ . }}" target="_blank" rel="noopener" class="btn btn-new-primary btn-sm">{{ partial "icon.html" (dict "style" "regular" "name" "images" "class" "mr-2") }}Slides</a>{{ end }} |
33 |
| - {{ with $ctx.Params.speaker_notebook }}<a href="{{ . }}" target="_blank" rel="noopener" class="btn btn-new-primary btn-sm">{{ partial "icon.html" (dict "style" "regular" "name" "folder" "class" "mr-2") }}Notebook</a>{{ end }} |
34 |
| - {{ with $ctx.Params.speaker_code }}<a href="{{ . }}" target="_blank" rel="noopener" class="btn btn-new-primary btn-sm">{{ partial "icon.html" (dict "style" "brands" "name" "github" "class" "mr-2") }}Code</a>{{ end }} |
35 |
| - {{ with $ctx.Params.video }}<a href="https://www.youtube.com/watch?v={{ . }}" target="_blank" rel="noopener" class="btn btn-new-primary btn-sm">{{ partial "icon.html" (dict "style" "brands" "name" "youtube" "class" "mr-2") }}Watch on YouTube</a>{{ end }} |
36 |
| - {{ if $ctx.Params.upcoming }} |
37 |
| - {{ $event_url := $ctx.Params.upcoming_url | default "https://www.youtube.com/@openneuromorphic" }} |
38 |
| - <a href="{{ $event_url }}" target="_blank" rel="noopener" class="btn btn-new-primary btn-sm">{{ partial "icon.html" (dict "style" "regular" "name" "calendar" "class" "mr-2") }}Event</a> |
39 |
| - {{ end }} |
40 |
| - </div> |
41 |
| - </li> |
42 |
| - {{ end }} |
| 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> |
43 | 59 | {{ end }}
|
44 |
| -</ul> |
| 60 | + |
| 61 | +</div> |
| 62 | +{{ end }} |
0 commit comments