6
6
{{ if $page_context.File }}
7
7
{{ $current_slug = path.Base $page_context.File.Dir }}
8
8
{{ end }}
9
- {{ $current_title := $page_context.Title }}
10
-
11
-
12
- {{/* --- Part 1: Find related content (blog, events) that tag this page --- */}}
13
9
10
+ {{/* --- Part 1: Find INCOMING links from other content (blog, events, etc.) --- */}}
14
11
{{ $tag_param_key := "" }}
15
12
{{ if eq $current_type "neuromorphic-hardware" }}
16
13
{{ $tag_param_key = ".Params.hardware_tags" }}
25
22
{{ end }}
26
23
{{ end }}
27
24
25
+ {{/* --- Part 2: Find OUTGOING links to other hardware/software --- */}}
28
26
29
- {{/* --- Part 2: Find related hardware/software (bidirectional linking) --- */}}
30
-
31
- {{ if eq $current_type "neuromorphic-hardware" }}
32
- {{/* I am a hardware page. Find software I support using my `software_tags` */}}
33
- {{ with .Params.software_tags }}
34
- {{ $software_slugs_to_find := . }}
35
- {{ $all_software_pages := where site.RegularPages "Type" "neuromorphic-software" }}
36
- {{ range $software_page := $all_software_pages }}
27
+ {{/* Find software this page links to */}}
28
+ {{ with .Params.software_tags }}
29
+ {{ $software_slugs_to_find := . }}
30
+ {{ $all_software_pages := where site.RegularPages "Type" "neuromorphic-software" }}
31
+ {{ range $software_page := $all_software_pages }}
32
+ {{ if ne $software_page.Permalink $page_context.Permalink }}
37
33
{{ $software_slug := "" }}
38
34
{{ if $software_page.File }}{{ $software_slug = path.Base $software_page.File.Dir }}{{ end }}
39
35
{{ if and (ne $software_slug "") (in $software_slugs_to_find $software_slug) }}
40
36
{{ $related_items = $related_items | append $software_page }}
41
37
{{ end }}
42
38
{{ end }}
43
39
{{ end }}
40
+ {{ end }}
44
41
45
- {{ else if and (eq $current_type "neuromorphic-software") (ne $current_slug "") }}
46
- {{/* I am a software page. Find hardware that supports me. */}}
47
- {{ $hardware_pages := where site.RegularPages "Type" "neuromorphic-hardware" }}
48
- {{ range where $hardware_pages ".Params.software_tags" "intersect" (slice $current_slug) }}
49
- {{ $related_items = $related_items | append . }}
42
+ {{/* Find hardware this page links to */}}
43
+ {{ with .Params.hardware_tags }}
44
+ {{ $hardware_slugs_to_find := . }}
45
+ {{ $all_hardware_pages := where site.RegularPages "Type" "neuromorphic-hardware" }}
46
+ {{ range $hardware_page := $all_hardware_pages }}
47
+ {{ if ne $hardware_page.Permalink $page_context.Permalink }}
48
+ {{ $hardware_slug := "" }}
49
+ {{ if $hardware_page.File }}{{ $hardware_slug = path.Base $hardware_page.File.Dir }}{{ end }}
50
+ {{ if and (ne $hardware_slug "") (in $hardware_slugs_to_find $hardware_slug) }}
51
+ {{ $related_items = $related_items | append $hardware_page }}
52
+ {{ end }}
53
+ {{ end }}
50
54
{{ end }}
51
55
{{ end }}
52
56
57
+
53
58
{{/* --- Finalize and Render --- */}}
54
- {{/* Deduplicate */}}
55
59
{{ $unique_related_items := slice }}
56
60
{{ $seen_permalinks := slice }}
57
61
{{ range $related_items }}
@@ -72,7 +76,6 @@ <h2 class="text-3xl font-bold mb-8">Related Content, Events & Resources</h2>
72
76
< div class ="timeline-item-content ">
73
77
< div class ="flex flex-col md:flex-row items-start gap-5 ">
74
78
75
- {{/* Thumbnail Column - Renders only if image is in front matter */}}
76
79
{{ with $item.Params.image }}
77
80
< div class ="flex-shrink-0 w-full md:w-40 text-center ">
78
81
< a href ="{{ $item.RelPermalink }} ">
@@ -98,7 +101,6 @@ <h2 class="text-3xl font-bold mb-8">Related Content, Events & Resources</h2>
98
101
</ div >
99
102
{{ end }}
100
103
101
- {{/* Content Column */}}
102
104
< div class ="flex-grow ">
103
105
< div class ="flex justify-between items-start gap-4 ">
104
106
< div >
0 commit comments