Skip to content

Commit 5e57599

Browse files
committed
style: Improve link styling and contributor display
Fixes link styling and unifies maintainer list handling to ensure proper display of multiple contributors.
1 parent 72f5b56 commit 5e57599

File tree

2 files changed

+77
-99
lines changed

2 files changed

+77
-99
lines changed

assets/scss/_typography-custom.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ a {
111111
overflow-wrap: break-word;
112112
}
113113

114+
.styled-link,
114115
.content :is(:where(a):not(:where([class~="not-prose"], [class~="not-prose"] *, .btn))),
115116
section a:not(.breadcrumb-link-parent, .social-link-container, .btn, .hardware-card-wide-link, .social-icon) {
116117
font-weight: inherit;

layouts/partials/components/software-list.html

Lines changed: 76 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -3,114 +3,91 @@
33
<ul class="list-none p-0">
44
{{ $mainSoftwarePage := site.GetPage "neuromorphic-computing/software" }}
55
{{ $isMainSoftwarePage := eq . $mainSoftwarePage }}
6-
6+
77
{{ $allSoftwarePages := where site.RegularPages "Params.type" "neuromorphic-software" }}
88
{{ $sortedSoftwarePages := sort $allSoftwarePages "Params.stars" "desc" }}
99

1010
{{ range $sortedSoftwarePages }}
11-
{{ $page := . }}
11+
{{ $page := . }}
1212

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 }}
2121

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>
3333

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>
3535

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">
10337

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 }}
11491
{{ end }}
11592
</ul>
11693
</div>

0 commit comments

Comments
 (0)