|
3 | 3 | <ul class="list-none p-0">
|
4 | 4 | {{ $mainSoftwarePage := site.GetPage "neuromorphic-computing/software" }}
|
5 | 5 | {{ $isMainSoftwarePage := eq . $mainSoftwarePage }}
|
6 |
| - |
| 6 | + |
7 | 7 | {{ $allSoftwarePages := where site.RegularPages "Params.type" "neuromorphic-software" }}
|
8 | 8 | {{ $sortedSoftwarePages := sort $allSoftwarePages "Params.stars" "desc" }}
|
9 | 9 |
|
10 | 10 | {{ range $sortedSoftwarePages }}
|
11 |
| - {{ $page := . }} |
| 11 | + {{ $page := . }} |
12 | 12 |
|
13 |
| - {{ $displayPage := false }} |
14 |
| - {{ if $isMainSoftwarePage }} |
15 |
| - {{ $displayPage = true }} |
16 |
| - {{ else }} |
17 |
| - {{ if $page.IsDescendant $mainSoftwarePage }} |
18 |
| - {{ $displayPage = true }} |
19 |
| - {{ end }} |
20 |
| - {{ end }} |
| 13 | + {{ $displayPage := false }} |
| 14 | + {{ if $isMainSoftwarePage }} |
| 15 | + {{ $displayPage = true }} |
| 16 | + {{ else }} |
| 17 | + {{ if $page.IsDescendant $mainSoftwarePage }} |
| 18 | + {{ $displayPage = true }} |
| 19 | + {{ end }} |
| 20 | + {{ end }} |
21 | 21 |
|
22 |
| - {{ if $displayPage }} |
23 |
| - <li class="mb-6 content-panel p-6 shadow-lg rounded-lg"> |
24 |
| - <div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 mb-3"> |
25 |
| - <h3 class="text-xl font-bold"> |
26 |
| - <a href="{{ .Permalink }}" class="text-dark dark:text-darkmode-dark hover:text-primary dark:hover:text-darkmode-primary">{{ .Title }}</a> |
27 |
| - </h3> |
28 |
| - <div class="flex items-center space-x-2 flex-shrink-0"> |
29 |
| - {{ with .Params.version_widget_url }}<img class="h-5" src="{{ . }}" alt="Version">{{ end }} |
30 |
| - {{ with .Params.stars_widget_url }}<img class="h-5" src="{{ . }}" alt="Stars">{{ end }} |
31 |
| - </div> |
32 |
| - </div> |
| 22 | + {{ if $displayPage }} |
| 23 | + <li class="mb-6 content-panel p-6 shadow-lg rounded-lg"> |
| 24 | + <div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 mb-3"> |
| 25 | + <h3 class="text-xl font-bold"> |
| 26 | + <a href="{{ .Permalink }}" class="text-dark dark:text-darkmode-dark hover:text-primary dark:hover:text-darkmode-primary">{{ .Title }}</a> |
| 27 | + </h3> |
| 28 | + <div class="flex items-center space-x-2 flex-shrink-0"> |
| 29 | + {{ with .Params.version_widget_url }}<img class="h-5" src="{{ . }}" alt="Version">{{ end }} |
| 30 | + {{ with .Params.stars_widget_url }}<img class="h-5" src="{{ . }}" alt="Stars">{{ end }} |
| 31 | + </div> |
| 32 | + </div> |
33 | 33 |
|
34 |
| - <p class="mb-4 text-text dark:text-darkmode-text">{{ .Params.description }}</p> |
| 34 | + <p class="mb-4 text-text dark:text-darkmode-text">{{ .Params.description }}</p> |
35 | 35 |
|
36 |
| - <div class="border-t border-border dark:border-darkmode-border pt-4 flex flex-col sm:flex-row items-center justify-between gap-4"> |
37 |
| - |
38 |
| - <div class="flex items-center gap-3"> |
39 |
| - {{ with .Params.maintainer }} |
40 |
| - {{ $maintainerList := . }} |
41 |
| - {{ if reflect.IsSlice $maintainerList }} |
42 |
| - <div class="flex -space-x-3"> |
43 |
| - {{ range $maintainerList }} |
44 |
| - {{ $maintainerName := . }} |
45 |
| - {{ $nameForProcessing := $maintainerName | replaceRE "[.]" "" | replaceRE "ć" "c" | replaceRE "Ć" "C" }} |
46 |
| - {{ $contributorSlug := $nameForProcessing | anchorize }} |
47 |
| - {{ $contributorPage := $page.Site.GetPage (printf "contributors/%s" $contributorSlug) }} |
48 |
| - {{ if and $contributorPage $contributorPage.Params.image }} |
49 |
| - {{ with $contributorPage.Resources.GetMatch $contributorPage.Params.image }} |
50 |
| - {{ $thumb := .Fill "40x40 Lanczos" }} |
51 |
| - <img src="{{ $thumb.RelPermalink }}" alt="{{ $maintainerName }}" title="{{ $maintainerName }}" class="w-10 h-10 rounded-full object-cover border-2 border-white dark:border-gray-800"> |
52 |
| - {{ end }} |
53 |
| - {{ else }} |
54 |
| - <div class="w-10 h-10 rounded-full bg-gray-200 dark:bg-darkmode-theme-dark flex items-center justify-center text-gray-400 border-2 border-white dark:border-gray-800" title="{{ $maintainerName }}"> |
55 |
| - {{ partial "icon.html" (dict "style" "solid" "name" "user" "class" "text-lg") }} |
56 |
| - </div> |
57 |
| - {{ end }} |
58 |
| - {{ end }} |
59 |
| - </div> |
60 |
| - <div> |
61 |
| - <p class="text-xs text-text dark:text-darkmode-text">Maintained by</p> |
62 |
| - <p class="font-semibold"> |
63 |
| - {{ $links := slice }} |
64 |
| - {{ range $maintainerList }} |
65 |
| - {{ $nameForProcessing := . | replaceRE "[.]" "" | replaceRE "ć" "c" | replaceRE "Ć" "C" }} |
66 |
| - {{ $contributorSlug := $nameForProcessing | anchorize }} |
67 |
| - {{ $contributorPage := $page.Site.GetPage (printf "contributors/%s" $contributorSlug) }} |
68 |
| - {{ if $contributorPage }} |
69 |
| - {{ $links = $links | append (printf `<a href="%s" class="text-primary dark:text-darkmode-primary hover:underline">%s</a>` $contributorPage.RelPermalink .) }} |
70 |
| - {{ else }} |
71 |
| - {{ $links = $links | append (printf `<span class="text-dark dark:text-darkmode-dark">%s</span>` .) }} |
72 |
| - {{ end }} |
73 |
| - {{ end }} |
74 |
| - {{ delimit $links ", " | safeHTML }} |
75 |
| - </p> |
76 |
| - </div> |
77 |
| - {{ else }} |
78 |
| - {{ $maintainerName := . }} |
79 |
| - {{ $nameForProcessing := $maintainerName | replaceRE "[.]" "" | replaceRE "ć" "c" | replaceRE "Ć" "C" }} |
80 |
| - {{ $contributorSlug := $nameForProcessing | anchorize }} |
81 |
| - {{ $contributorPage := $page.Site.GetPage (printf "contributors/%s" $contributorSlug) }} |
82 |
| - {{ if and $contributorPage $contributorPage.Params.image }} |
83 |
| - {{ with $contributorPage.Resources.GetMatch $contributorPage.Params.image }} |
84 |
| - {{ $thumb := .Fill "40x40 Lanczos" }} |
85 |
| - <img src="{{ $thumb.RelPermalink }}" alt="Maintainer: {{ $maintainerName }}" class="w-10 h-10 rounded-full object-cover"> |
86 |
| - {{ end }} |
87 |
| - {{ else }} |
88 |
| - <div class="w-10 h-10 rounded-full bg-gray-200 dark:bg-darkmode-theme-dark flex items-center justify-center text-gray-400"> |
89 |
| - {{ partial "icon.html" (dict "style" "solid" "name" "user" "class" "text-lg") }} |
90 |
| - </div> |
91 |
| - {{ end }} |
92 |
| - <div> |
93 |
| - <p class="text-xs text-text dark:text-darkmode-text">Maintained by</p> |
94 |
| - {{ if $contributorPage }} |
95 |
| - <a href="{{ $contributorPage.RelPermalink }}" class="font-semibold text-primary dark:text-darkmode-primary hover:underline">{{ . }}</a> |
96 |
| - {{ else }} |
97 |
| - <p class="font-semibold text-dark dark:text-darkmode-dark">{{ . }}</p> |
98 |
| - {{ end }} |
99 |
| - </div> |
100 |
| - {{ end }} |
101 |
| - {{ end }} |
102 |
| - </div> |
| 36 | + <div class="border-t border-border dark:border-darkmode-border pt-4 flex flex-col sm:flex-row items-center justify-between gap-4"> |
103 | 37 |
|
104 |
| - <div class="flex items-center gap-4"> |
105 |
| - <div class="flex flex-wrap gap-2"> |
106 |
| - {{ if .Params.supports_NIR }}<span class="support-badge">NIR Support</span>{{ end }} |
107 |
| - {{ if .Params.supports_hardware }}<span class="support-badge">Hardware Support</span>{{ end }} |
108 |
| - </div> |
109 |
| - <a href="{{ .Permalink }}" class="btn btn-new-outline btn-sm !py-2 !px-4 flex-shrink-0">View Details</a> |
110 |
| - </div> |
111 |
| - </div> |
112 |
| - </li> |
113 |
| - {{ end }} |
| 38 | + <div class="flex items-center gap-3"> |
| 39 | + {{ with .Params.maintainer }} |
| 40 | + {{ $maintainerList := . }} |
| 41 | + {{ if not (reflect.IsSlice .) }}{{ $maintainerList = slice . }}{{ end }} {{/* Unify to a slice */}} |
| 42 | + |
| 43 | + <div class="flex -space-x-3"> |
| 44 | + {{ range $maintainerList }} |
| 45 | + {{ $maintainerName := . }} |
| 46 | + {{ $nameForProcessing := $maintainerName | replaceRE "[.]" "" | replaceRE "ć" "c" | replaceRE "Ć" "C" }} |
| 47 | + {{ $contributorSlug := $nameForProcessing | anchorize }} |
| 48 | + {{ $contributorPage := $page.Site.GetPage (printf "contributors/%s" $contributorSlug) }} |
| 49 | + {{ if and $contributorPage $contributorPage.Params.image }} |
| 50 | + {{ with $contributorPage.Resources.GetMatch $contributorPage.Params.image }} |
| 51 | + {{ $thumb := .Fill "40x40 Lanczos" }} |
| 52 | + <img src="{{ $thumb.RelPermalink }}" alt="{{ $maintainerName }}" title="{{ $maintainerName }}" class="w-10 h-10 rounded-full object-cover border-2 border-white dark:border-gray-800"> |
| 53 | + {{ end }} |
| 54 | + {{ else }} |
| 55 | + <div class="w-10 h-10 rounded-full bg-gray-200 dark:bg-darkmode-theme-dark flex items-center justify-center text-gray-400 border-2 border-white dark:border-gray-800" title="{{ $maintainerName }}"> |
| 56 | + {{ partial "icon.html" (dict "style" "solid" "name" "user" "class" "text-lg") }} |
| 57 | + </div> |
| 58 | + {{ end }} |
| 59 | + {{ end }} |
| 60 | + </div> |
| 61 | + <div> |
| 62 | + <p class="text-xs text-text dark:text-darkmode-text">Maintained by</p> |
| 63 | + <p class="font-semibold text-primary dark:text-darkmode-primary"> |
| 64 | + {{ $links := slice }} |
| 65 | + {{ range $maintainerList }} |
| 66 | + {{ $nameForProcessing := . | replaceRE "[.]" "" | replaceRE "ć" "c" | replaceRE "Ć" "C" }} |
| 67 | + {{ $contributorSlug := $nameForProcessing | anchorize }} |
| 68 | + {{ $contributorPage := $page.Site.GetPage (printf "contributors/%s" $contributorSlug) }} |
| 69 | + {{ if $contributorPage }} |
| 70 | + {{ $links = $links | append (printf `<a href="%s">%s</a>` $contributorPage.RelPermalink .) }} |
| 71 | + {{ else }} |
| 72 | + {{ $links = $links | append (printf `<span>%s</span>` .) }} |
| 73 | + {{ end }} |
| 74 | + {{ end }} |
| 75 | + {{ delimit $links ", " | safeHTML }} |
| 76 | + </p> |
| 77 | + </div> |
| 78 | + {{ end }} |
| 79 | + </div> |
| 80 | + |
| 81 | + <div class="flex items-center gap-4"> |
| 82 | + <div class="flex flex-wrap gap-2"> |
| 83 | + {{ if .Params.supports_NIR }}<span class="support-badge">NIR Support</span>{{ end }} |
| 84 | + {{ if .Params.supports_hardware }}<span class="support-badge">Hardware Support</span>{{ end }} |
| 85 | + </div> |
| 86 | + <a href="{{ .Permalink }}" class="btn btn-new-outline btn-sm !py-2 !px-4 flex-shrink-0">View Details</a> |
| 87 | + </div> |
| 88 | + </div> |
| 89 | + </li> |
| 90 | + {{ end }} |
114 | 91 | {{ end }}
|
115 | 92 | </ul>
|
116 | 93 | </div>
|
0 commit comments