Skip to content

Commit 2b31921

Browse files
committed
Render .md from /tools/ and /services/ directories together in Resource Hub
1 parent dcfff81 commit 2b31921

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/app/(main)/resources/[category]/category-tools-libraries-section.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ async function loadLibraries(): Promise<LibraryEntry[]> {
6363

6464
function displayName(id: string) {
6565
const key = id as keyof typeof slugMap
66+
67+
if (key === "tools" || key === "services") {
68+
return "Tools / Services"
69+
}
70+
6671
return slugMap[key] ?? id
6772
}
6873

@@ -80,6 +85,11 @@ export async function CategoryToolsLibrariesSection({
8085
filtered.reduce<Map<string, LibraryEntry[]>>((acc, item) => {
8186
const list = acc.get(item.group) ?? []
8287
list.push(item)
88+
89+
if (item.group === "tools") {
90+
item.group = "services"
91+
}
92+
8393
acc.set(item.group, list)
8494
return acc
8595
}, new Map()),
@@ -114,10 +124,16 @@ export async function CategoryToolsLibrariesSection({
114124
id="tools-and-libraries"
115125
className={clsx(
116126
"gql-container gql-section relative flex flex-col gap-8 overflow-hidden",
127+
grouped.length > 1 ? "" : "lg:flex-row",
117128
className,
118129
)}
119130
>
120-
<div className="flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between">
131+
<div
132+
className={clsx(
133+
"flex flex-col gap-3 lg:justify-between",
134+
grouped.length > 1 ? "lg:flex-row lg:items-end" : "",
135+
)}
136+
>
121137
<div className="flex flex-col gap-4 xl:gap-6">
122138
<Eyebrow className="!text-pri-base dark:!text-pri-light">
123139
tools & libraries
@@ -133,7 +149,7 @@ export async function CategoryToolsLibrariesSection({
133149
<Button
134150
href="/community/tools-and-libraries/"
135151
variant="secondary"
136-
className="md:w-fit"
152+
className="md:w-fit [&:not(:hover)]:!bg-neu-200 dark:[&:not(:hover)]:!bg-neu-100"
137153
>
138154
See all Tools & Libraries
139155
</Button>

0 commit comments

Comments
 (0)