|
2 | 2 |
|
3 | 3 | {{ if $related_events }}
|
4 | 4 | <div class="related-events-section mt-12 pt-8 pb-8">
|
5 |
| - <h2 class="text-3xl font-bold mb-6">Related Content & Events</h2> |
6 |
| - <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> |
7 |
| - {{ range $related_events }} |
8 |
| - <div class="bg-theme-light dark:bg-darkmode-theme-light rounded-lg p-5 shadow-md hover:shadow-lg transition-shadow duration-300"> |
9 |
| - <h4 class="text-lg font-semibold mb-2"> |
10 |
| - <a href="{{ .RelPermalink }}" class="text-primary dark:text-darkmode-primary hover:underline"> |
11 |
| - {{ .Title }} |
| 5 | + <h2 class="text-3xl font-bold mb-8">Related Content & Events</h2> |
| 6 | + |
| 7 | + <div class="space-y-6"> |
| 8 | + {{ range $event := $related_events }} |
| 9 | + <div class="timeline-item-content"> |
| 10 | + <div class="flex flex-col md:flex-row items-start gap-5"> |
| 11 | + |
| 12 | + {{/* Thumbnail Column */}} |
| 13 | + <div class="flex-shrink-0 w-full md:w-40 text-center"> |
| 14 | + <a href="{{ $event.RelPermalink }}"> |
| 15 | + {{ $image_param := $event.Params.image }} |
| 16 | + {{ $img_path := "" }} |
| 17 | + {{ $img_alt := $event.Title }} |
| 18 | + |
| 19 | + {{ if $image_param }} |
| 20 | + {{ $img_path_cleaned := strings.TrimPrefix "/" $image_param }} |
| 21 | + {{ $resource := "" }} |
| 22 | + {{ with $event.Resources.GetMatch $image_param }} |
| 23 | + {{ $resource = . }} |
| 24 | + {{ else }} |
| 25 | + {{ with resources.Get $img_path_cleaned }} |
| 26 | + {{ $resource = . }} |
| 27 | + {{ end }} |
| 28 | + {{ end }} |
| 29 | + |
| 30 | + {{ if $resource }} |
| 31 | + {{ $img_path = ($resource.Fill "160x90 Lanczos").RelPermalink }} |
| 32 | + {{ else if fileExists (printf "static/%s" $img_path_cleaned) }} |
| 33 | + {{ $img_path = $image_param | relURL }} |
| 34 | + {{ end }} |
| 35 | + {{ end }} |
| 36 | + |
| 37 | + {{ if not $img_path }} |
| 38 | + {{ with resources.Get "images/workshop-thumbnail-default.png" }} |
| 39 | + {{ $img_path = (.Fill "160x90 Lanczos").RelPermalink }} |
| 40 | + {{ $img_alt = "Default Open Neuromorphic Event Thumbnail" }} |
| 41 | + {{ end }} |
| 42 | + {{ end }} |
| 43 | + |
| 44 | + {{ if $img_path }} |
| 45 | + <img src="{{ $img_path }}" alt="{{ $img_alt }}" class="w-full h-auto rounded-md object-cover"> |
| 46 | + {{ else }} |
| 47 | + <div class="w-full h-[90px] bg-gray-200 dark:bg-darkmode-theme-dark rounded-md flex items-center justify-center"> |
| 48 | + {{ partial "icon.html" (dict "style" "regular" "name" "images" "class" "text-4xl text-gray-400") }} |
| 49 | + </div> |
| 50 | + {{ end }} |
12 | 51 | </a>
|
13 |
| - </h4> |
14 |
| - <p class="text-sm text-gray-500 dark:text-gray-400 mb-3"> |
15 |
| - <span class="capitalize">{{ .Type | default .Section | humanize }}</span> · {{ .Date.Format "January 2, 2006" }} |
16 |
| - </p> |
17 |
| - <p class="text-sm text-text dark:text-darkmode-text">{{ .Description | truncate 100 }}</p> |
| 52 | + </div> |
| 53 | + |
| 54 | + {{/* Content Column */}} |
| 55 | + <div class="flex-grow"> |
| 56 | + <div class="flex justify-between items-start gap-4"> |
| 57 | + <div> |
| 58 | + <h4 class="text-xl font-semibold mb-1"> |
| 59 | + <a href="{{ $event.RelPermalink }}" class="text-dark dark:text-darkmode-dark hover:text-primary dark:hover:text-darkmode-primary">{{ $event.Title }}</a> |
| 60 | + </h4> |
| 61 | + <p class="text-sm text-gray-500 dark:text-gray-400"> |
| 62 | + {{ $event.Date.Format "January 2, 2006" }} |
| 63 | + </p> |
| 64 | + </div> |
| 65 | + <span class="timeline-item-badge flex-shrink-0"> |
| 66 | + {{ $event.Type | default $event.Section | humanize | title }} |
| 67 | + </span> |
| 68 | + </div> |
| 69 | + {{ if $event.Description }} |
| 70 | + <p class="text-gray-600 dark:text-gray-400 mt-3 text-sm">{{ $event.Description | truncate 150 }}</p> |
| 71 | + {{ end }} |
| 72 | + </div> |
| 73 | + |
18 | 74 | </div>
|
| 75 | + </div> |
19 | 76 | {{ end }}
|
20 | 77 | </div>
|
21 | 78 | </div>
|
|
0 commit comments