@@ -22,12 +22,84 @@ interface FooterSection {
22
22
links : FooterLink [ ]
23
23
}
24
24
25
- const FOOTER_SECTIONS_COUNT = 4
26
- const MAX_LINKS_PER_SECTION = 5
25
+ const FOOTER_SECTIONS : FooterSection [ ] = [
26
+ {
27
+ title : "Learn" ,
28
+ route : "/learn" ,
29
+ links : [
30
+ { title : "Introduction to GraphQL" , route : "/learn" } ,
31
+ {
32
+ title : "Frequently Asked Questions" ,
33
+ route : "/faq" ,
34
+ } ,
35
+ {
36
+ title : "Training Courses" ,
37
+ route : "/community/resources/training-courses" ,
38
+ } ,
39
+ ] ,
40
+ } ,
41
+ {
42
+ title : "Code" ,
43
+ links : [
44
+ { title : "GitHub" , route : "https://github.com/graphql" } ,
45
+ {
46
+ title : "GraphQL Specification" ,
47
+ route : "/spec" ,
48
+ } ,
49
+ { title : "Libraries & Tools" , route : "/code" } ,
50
+ {
51
+ title : "Services & Vendors" ,
52
+ route : "/code/?tags=services" ,
53
+ } ,
54
+ ] ,
55
+ } ,
56
+ {
57
+ title : "Community" ,
58
+ links : [
59
+ {
60
+ title : "Resources" ,
61
+ route : "/community/resources/official-channels" ,
62
+ } ,
63
+ {
64
+ title : "Events & Meetups" ,
65
+ route : "/community/events" ,
66
+ } ,
67
+ {
68
+ title : "Contribute to GraphQL" ,
69
+ route : "/community/contribute/essential-links" ,
70
+ } ,
71
+ { title : "Landscape" , route : "/landscape" } ,
72
+ { title : "Shop" , route : "/shop" } ,
73
+ ] ,
74
+ } ,
75
+ {
76
+ title : "& More" ,
77
+ links : [
78
+ { title : "Blog" , route : "/blog" } ,
79
+ {
80
+ title : "GraphQL Foundation" ,
81
+ route : "/foundation" ,
82
+ } ,
83
+ {
84
+ title : "GraphQL Community Grant" ,
85
+ route : "/foundation/community-grant" ,
86
+ } ,
87
+ {
88
+ title : "Logo and Brand Guidelines" ,
89
+ route : "/brand" ,
90
+ } ,
91
+ {
92
+ title : "Code of Conduct" ,
93
+ route : "/codeofconduct" ,
94
+ } ,
95
+ ] ,
96
+ } ,
97
+ ]
98
+
27
99
const CONFERENCE_YEAR = 2025
100
+ const HAS_CONFERENCE_BOX = true
28
101
29
- export function Footer ( { extraLinks } : { extraLinks : FooterLink [ ] } ) {
30
- const { sections, hasConferenceBox } = useFooterSections ( extraLinks )
102
+ export function Footer ( ) {
31
103
const themeConfig = useThemeConfig ( )
32
104
33
105
return (
@@ -42,7 +114,7 @@ export function Footer({ extraLinks }: { extraLinks: FooterLink[] }) {
42
114
</ div >
43
115
44
116
< div className = "grid grid-cols-2 gap-px bg-neu-400 py-px dark:bg-neu-100 lg:grid-cols-5" >
45
- { sections . map ( ( section , i ) => (
117
+ { FOOTER_SECTIONS . map ( ( section , i ) => (
46
118
< div
47
119
className = "typography-menu relative bg-neu-100 py-4 dark:bg-neu-0 lg:py-6 3xl:py-10"
48
120
key = { i }
@@ -73,7 +145,7 @@ export function Footer({ extraLinks }: { extraLinks: FooterLink[] }) {
73
145
</ div >
74
146
) ) }
75
147
< div className = "flex flex-col max-lg:contents" >
76
- { hasConferenceBox && (
148
+ { HAS_CONFERENCE_BOX && (
77
149
< ConferenceFooterBox
78
150
href = { `/conf/${ CONFERENCE_YEAR } ` }
79
151
className = "z-[2] col-span-full flex-1 max-lg:row-start-1"
@@ -151,42 +223,3 @@ function Stripes() {
151
223
</ div >
152
224
)
153
225
}
154
-
155
- function useFooterSections ( extraLinks : FooterLink [ ] ) : {
156
- sections : FooterSection [ ]
157
- hasConferenceBox : boolean
158
- } {
159
- const { normalizePagesResult } = useConfig ( )
160
-
161
- const sections : FooterSection [ ] = [ ]
162
- const singleLinks : FooterLink [ ] = [ ]
163
- let hasConferenceBox = false
164
-
165
- for ( const item of normalizePagesResult . topLevelNavbarItems ) {
166
- if (
167
- ( item . type === "page" || item . type === "menu" ) &&
168
- item . children ?. length &&
169
- sections . length < FOOTER_SECTIONS_COUNT - 1
170
- ) {
171
- sections . push ( {
172
- title : item . title ,
173
- route : item . route ,
174
- links : ( item . children || [ ] )
175
- . filter ( child => child . route )
176
- . slice ( 0 , MAX_LINKS_PER_SECTION )
177
- . map ( child => ( { title : child . title , route : child . route } ) ) ,
178
- } )
179
- } else if ( singleLinks . length < MAX_LINKS_PER_SECTION ) {
180
- if ( item . route && item . route . startsWith ( "/conf/" ) ) {
181
- hasConferenceBox = true
182
- } else {
183
- singleLinks . push ( { title : item . title , route : item . route } )
184
- }
185
- }
186
- }
187
-
188
- singleLinks . push ( ...extraLinks )
189
- sections . push ( { links : singleLinks } )
190
-
191
- return { sections, hasConferenceBox }
192
- }
0 commit comments