Skip to content

Commit 1625a3e

Browse files
committed
Add content to the AI page
1 parent 0b1aefd commit 1625a3e

File tree

7 files changed

+24
-39
lines changed

7 files changed

+24
-39
lines changed

src/app/(main)/resources/[category]/categories-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export const sectionKindNames: Record<Kind, string> = {
179179
book: "Books",
180180
"blog-or-newsletter": "Blogs & Newsletters",
181181
docs: "Documentation",
182-
event: "Upcoming events",
182+
event: "Events",
183183
post: "Community posts",
184184
list: "Community lists",
185185
}

src/app/(main)/resources/[category]/category-working-groups.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,9 @@ export async function CategoryWorkingGroups({
2727
)
2828

2929
const hasFutureEvents = futureEvents.length > 0
30-
const events = hasFutureEvents
31-
? futureEvents
32-
: matchingMeetings
33-
.filter(event => new Date(event.start).getTime() < Date.now())
34-
.sort((a, b) => new Date(b.start).getTime() - new Date(a.start).getTime())
35-
.slice(0, 4)
30+
31+
// soonest/most recent first
32+
const events = hasFutureEvents ? futureEvents : matchingMeetings.reverse()
3633

3734
if (events.length === 0) return null
3835

@@ -43,7 +40,9 @@ export async function CategoryWorkingGroups({
4340
>
4441
<header className="flex flex-col gap-6 lg:flex-row lg:items-end lg:justify-between">
4542
<div className="flex flex-col gap-4 xl:gap-6">
46-
<Eyebrow>{hasFutureEvents ? "Upcoming events" : "Past events"}</Eyebrow>
43+
<Eyebrow>
44+
{hasFutureEvents ? "Upcoming events" : "Past events"}
45+
</Eyebrow>
4746
<h2 className="typography-h2 max-w-[700px] text-pretty">{heading}</h2>
4847
<p className="typography-body-md max-w-[577px] text-neu-800">
4948
{text}

src/app/(main)/resources/[category]/page.tsx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ export default async function CategoryPage({ params }: { params: PageParams }) {
6060

6161
if (sections.length === 0) sections = Array.from(grouped.keys())
6262

63-
sections = await removeEventsSectionWithoutFutureEvents(sections, category)
64-
6563
const activePath: Item[] = [
6664
{
6765
name: "Home",
@@ -130,28 +128,6 @@ export default async function CategoryPage({ params }: { params: PageParams }) {
130128
)
131129
}
132130

133-
/**
134-
* if there are no events at all, we remove the section from the TOC
135-
*/
136-
async function removeEventsSectionWithoutFutureEvents(
137-
sections: Kind[],
138-
category: Topic,
139-
) {
140-
if (sections.includes("event")) {
141-
const events = await loadWorkingGroupMeetings()
142-
const predicate = categoriesConfig[category].sections.event?.predicate
143-
144-
if (predicate) {
145-
const matchingEvents = events.filter(predicate)
146-
147-
if (matchingEvents.length === 0)
148-
return sections.filter(section => section !== "event")
149-
}
150-
}
151-
152-
return sections
153-
}
154-
155131
function uniqueByTitle(resources: ResourceMetadata[]) {
156132
const seen = new Set<string>()
157133
return resources.filter(resource => {

src/app/(main)/resources/resource-hub-card.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ export function ResourceHubCard({
6868
"text-pretty text-neu-900",
6969
title.length > 100
7070
? "typography-body-lg"
71-
: "typography-h4 md:typography-h3",
71+
: title.length > 65
72+
? "typography-h4"
73+
: "typography-h4 md:typography-h3",
7274
)}
7375
>
7476
{title}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"title": "An AI-enabled Supergraph: From Text-to-Query to Conversational Agents",
3+
"url": "https://www.youtube.com/watch?v=iJvEf0vfxvA",
4+
"tags": ["ai", "video"],
5+
"duration": "33:27",
6+
"author": "Ben Newman"
7+
}

src/resources/data/graphql-field-discovery-genai.json

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"title": "Why AI Needs GraphQL",
3+
"author": "Anant Jhingran",
4+
"url": "https://youtu.be/bnWMiI9q4bc",
5+
"tags": ["ai", "video"],
6+
"duration": "31:24"
7+
}

0 commit comments

Comments
 (0)