Skip to content

Commit d28ee96

Browse files
New structure (#161)
* First pass at new structure (in English only for now) * New structure in all languages * Update dependencies * Update links * Add redirects * More consistent page titles and URLs * Add “Subgraphs” heading to navigation * Update dependencies * Rename “The Graph Explorer” to “Graph Explorer” * Rename “Network” to “The Graph Network” * Update dependencies * Consolidate Supported Networks list (#166) * Consolidate Supported Networks list * Minro Changes * EVM chains note * Changes * Moving notes Co-authored-by: ahmadmardeni1 <ahmadmardeni0@gmail.com> Co-authored-by: ahmadmardeni1 <ahmadmardeni0@gmail.com>
1 parent 1b0bb9b commit d28ee96

File tree

270 files changed

+6474
-3384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+6474
-3384
lines changed

components/NavTree.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export type NavTreeGroupHeadingProps = HTMLAttributes<HTMLElement> & {
4343
}
4444
export type NavTreeGroupContentProps = HTMLAttributes<HTMLElement>
4545
export type NavTreeDividerProps = Omit<HTMLAttributes<HTMLElement>, 'children'>
46+
export type NavTreeHeadingProps = HTMLAttributes<HTMLElement>
4647

4748
const NavTree = ({ children, textProps, ...props }: NavTreeProps) => {
4849
return (
@@ -182,10 +183,19 @@ const NavTreeDivider = (props: NavTreeDividerProps) => {
182183
)
183184
}
184185

186+
const NavTreeHeading = ({ children, ...props }: NavTreeHeadingProps) => {
187+
return (
188+
<li sx={{ mt: Spacing.XL, mb: Spacing.M_L, pl: Spacing.L_XL }} {...props}>
189+
<Text.C12 color="White48">{children}</Text.C12>
190+
</li>
191+
)
192+
}
193+
185194
NavTree.Item = NavTreeItem
186195
NavTree.Group = NavTreeGroup
187196
NavTreeGroup.Heading = NavTreeGroupHeading
188197
NavTreeGroup.Content = NavTreeGroupContent
189198
NavTree.Divider = NavTreeDivider
199+
NavTree.Heading = NavTreeHeading
190200

191201
export { NavTree }

layout/DocumentContext.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createContext, Context } from 'react'
22

33
export type Frontmatter = {
44
title?: string
5+
navTitle?: string
56
}
67

78
export type OutlineItem = {

layout/MDXLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export const MDXLayout = ({ pagePath, navItems, frontmatter, outline, children }
145145
<div
146146
sx={{
147147
display: ['flex', null, null, 'grid'],
148-
gridTemplateColumns: '216px auto 216px',
148+
gridTemplateColumns: '244px auto 216px',
149149
flexDirection: 'column',
150150
}}
151151
>

layout/MDXLayoutNav.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ export const MDXLayoutNav = ({ mobile = false }: { mobile?: boolean }) => {
166166
if ('divider' in navItem) {
167167
return <NavTree.Divider sx={mobile ? { mx: Spacing.L_XL, my: Spacing.L } : {}} />
168168
}
169+
if ('heading' in navItem) {
170+
return <NavTree.Heading>{navItem.heading}</NavTree.Heading>
171+
}
169172
if ('children' in navItem) {
170173
return (
171174
<NavTree.Group active={currentPage?.path.startsWith(navItem.path)}>

navigation/navigation.ts

Lines changed: 89 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,158 @@
11
import { NavItemDefinition } from './types'
22
import { AppLocale, translations } from '@/i18n'
33

4-
export const navigation: (locale: AppLocale) => NavItemDefinition[] = (locale) => [
4+
export const navigation = (locale: AppLocale): NavItemDefinition[] => [
55
{
66
slug: '',
77
},
88
{
9-
title: translations[locale].global.aboutTheGraph,
9+
divider: true,
10+
},
11+
{
1012
slug: 'about',
13+
},
14+
{
15+
title: translations[locale].global.navigation.theGraphNetwork,
16+
slug: 'network',
1117
children: [
1218
{
13-
slug: 'introduction',
19+
slug: 'overview',
20+
},
21+
{
22+
slug: 'indexing',
23+
},
24+
{
25+
slug: 'delegating',
26+
},
27+
{
28+
slug: 'curating',
1429
},
1530
{
16-
slug: 'network',
31+
slug: 'explorer',
1732
},
1833
],
1934
},
2035
{
2136
divider: true,
2237
},
2338
{
24-
title: translations[locale].global.developer,
25-
slug: 'developer',
39+
heading: translations[locale].global.navigation.subgraphs,
40+
},
41+
{
42+
title: translations[locale].global.navigation.developing,
43+
slug: 'developing',
2644
children: [
2745
{
28-
slug: 'quick-start',
46+
slug: 'supported-networks',
2947
},
3048
{
31-
slug: 'define-subgraph-hosted',
49+
slug: 'defining-a-subgraph',
3250
},
3351
{
34-
slug: 'create-subgraph-hosted',
52+
slug: 'creating-a-subgraph',
3553
},
3654
{
37-
slug: 'publish-subgraph',
55+
slug: 'assemblyscript-api',
3856
},
3957
{
40-
slug: 'query-the-graph',
58+
slug: 'unit-testing-framework',
4159
},
4260
{
43-
slug: 'querying-from-your-app',
61+
slug: 'developer-faqs',
4462
},
63+
],
64+
},
65+
{
66+
title: translations[locale].global.navigation.deploying,
67+
slug: 'deploying',
68+
children: [
4569
{
46-
slug: 'distributed-systems',
70+
slug: 'subgraph-studio',
4771
},
4872
{
49-
slug: 'assemblyscript-api',
73+
slug: 'deploying-a-subgraph-to-studio',
5074
},
5175
{
52-
slug: 'assemblyscript-migration-guide',
76+
slug: 'subgraph-studio-faqs',
5377
},
5478
{
55-
slug: 'graphql-api',
79+
slug: 'hosted-service',
5680
},
5781
{
58-
slug: 'matchstick',
82+
slug: 'deploying-a-subgraph-to-hosted',
5983
},
84+
],
85+
},
86+
{
87+
title: translations[locale].global.navigation.publishing,
88+
slug: 'publishing',
89+
children: [
6090
{
61-
slug: 'subgraph-debug-forking',
91+
slug: 'publishing-a-subgraph',
6292
},
93+
],
94+
},
95+
{
96+
title: translations[locale].global.navigation.managing,
97+
slug: 'managing',
98+
children: [
6399
{
64-
slug: 'deprecating-a-subgraph',
100+
slug: 'transferring-subgraph-ownership',
65101
},
66102
{
67-
slug: 'developer-faq',
103+
slug: 'deprecating-a-subgraph',
68104
},
69105
],
70106
},
71107
{
72-
slug: 'indexing',
73-
},
74-
{
75-
slug: 'delegating',
76-
},
77-
{
78-
slug: 'curating',
79-
},
80-
{
81-
divider: true,
82-
},
83-
{
84-
title: 'Subgraph Studio',
85-
slug: 'studio',
108+
title: translations[locale].global.navigation.querying,
109+
slug: 'querying',
86110
children: [
87111
{
88-
slug: 'subgraph-studio',
112+
slug: 'querying-the-graph',
89113
},
90114
{
91-
slug: 'deploy-subgraph-studio',
115+
slug: 'managing-api-keys',
92116
},
93117
{
94-
slug: 'billing',
118+
slug: 'querying-from-an-application',
95119
},
96120
{
97-
slug: 'managing-api-keys',
121+
slug: 'querying-best-practices',
98122
},
99123
{
100-
slug: 'studio-faq',
124+
slug: 'distributed-systems',
101125
},
102126
{
103-
slug: 'transferring-subgraph-ownership',
127+
slug: 'graphql-api',
128+
},
129+
{
130+
slug: 'querying-the-hosted-service',
131+
},
132+
{
133+
slug: 'billing',
104134
},
105135
],
106136
},
107137
{
108-
slug: 'explorer',
138+
divider: true,
109139
},
110140
{
111-
title: 'Hosted Service',
112-
slug: 'hosted-service',
141+
title: translations[locale].global.navigation.cookbook,
142+
slug: 'cookbook',
113143
children: [
114144
{
115-
slug: 'what-is-hosted-service',
145+
slug: 'quick-start',
116146
},
117147
{
118-
slug: 'deploy-subgraph-hosted',
148+
slug: 'migrating-a-subgraph',
119149
},
120150
{
121-
slug: 'query-hosted-service',
151+
slug: 'multisig',
122152
},
123153
{
124-
slug: 'migrating-subgraph',
154+
slug: 'subgraph-debug-forking',
125155
},
126-
],
127-
},
128-
{
129-
divider: true,
130-
},
131-
{
132-
title: translations[locale].global.supportedNetworks,
133-
slug: 'supported-networks',
134-
children: [
135156
{
136157
slug: 'near',
137158
},
@@ -143,4 +164,16 @@ export const navigation: (locale: AppLocale) => NavItemDefinition[] = (locale) =
143164
},
144165
],
145166
},
167+
{
168+
divider: true,
169+
},
170+
{
171+
title: translations[locale].global.navigation.releaseNotes,
172+
slug: 'release-notes',
173+
children: [
174+
{
175+
slug: 'assemblyscript-migration-guide',
176+
},
177+
],
178+
},
146179
]

navigation/types.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ export type NavItemDivider = {
3131
divider: true
3232
}
3333

34-
export type NavItem = NavItemPage | NavItemGroup | NavItemDivider
35-
export type NavItemPromise = NavItemPagePromise | NavItemGroupPromise | NavItemDivider
36-
export type NavItemDefinition = NavItemPageDefinition | NavItemGroupDefinition | NavItemDivider
34+
export type NavItemHeading = {
35+
heading: string
36+
}
37+
38+
export type NavItem = NavItemPage | NavItemGroup | NavItemDivider | NavItemHeading
39+
export type NavItemPromise = NavItemPagePromise | NavItemGroupPromise | NavItemDivider | NavItemHeading
40+
export type NavItemDefinition = NavItemPageDefinition | NavItemGroupDefinition | NavItemDivider | NavItemHeading

navigation/utils.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const getNavItems = async (locale: AppLocale = defaultLocale): Promise<Na
1515

1616
navItemsPromise = (async () => {
1717
const handleDefinition = (definition: NavItemDefinition, parentPath?: string): NavItemPromise => {
18-
if ('divider' in definition) {
18+
if ('divider' in definition || 'heading' in definition) {
1919
return definition
2020
}
2121
const path = `${parentPath ?? ''}/${definition.slug}`
@@ -38,11 +38,8 @@ export const getNavItems = async (locale: AppLocale = defaultLocale): Promise<Na
3838
const { frontmatter }: { frontmatter?: Frontmatter | ((locale: AppLocale) => Frontmatter) } =
3939
await import(`../pages/${fileToTry}`)
4040
if (!title && frontmatter) {
41-
if (typeof frontmatter === 'function') {
42-
title = frontmatter(locale).title
43-
} else {
44-
title = frontmatter.title
45-
}
41+
const frontmatterData = typeof frontmatter === 'function' ? frontmatter(locale) : frontmatter
42+
title = frontmatterData.navTitle ?? frontmatterData.title
4643
}
4744
break
4845
} catch (error) {
@@ -123,8 +120,8 @@ export const getNavItems = async (locale: AppLocale = defaultLocale): Promise<Na
123120
filteredItems.shift()
124121
}
125122

126-
// If the filtered items end with a divider due to missing pages/groups, remove it
127-
if (filteredItems.length > 0 && 'divider' in (filteredItems[filteredItems.length - 1] as NavItem)) {
123+
// If the filtered items end with a divider or a heading due to missing pages/groups, remove it
124+
if (lastFilteredItem && ('divider' in lastFilteredItem || 'heading' in lastFilteredItem)) {
128125
filteredItems.pop()
129126
}
130127

nginx.conf

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,42 @@ http {
4848
rewrite ^/docs/hostedservice/(.*)$ $scheme://$http_host/docs/en/hosted-service/$1 permanent;
4949
rewrite ^/docs/(?!(?:[a-zA-Z][a-zA-Z]|_next|img)(?:/|$))(.*)$ $scheme://$http_host/docs/en/$1 permanent; # Redirect to `/en` if no language in URL and not an asset URL
5050

51+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/about/introduction/$ $scheme://$http_host/docs/$1/about/ permanent;
52+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/about/network/$ $scheme://$http_host/docs/$1/network/overview/ permanent;
53+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/curating/$ $scheme://$http_host/docs/$1/network/curating/ permanent;
54+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/delegating/$ $scheme://$http_host/docs/$1/network/delegating/ permanent;
55+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/assemblyscript-api/$ $scheme://$http_host/docs/$1/developing/assemblyscript-api/ permanent;
56+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/assemblyscript-migration-guide/$ $scheme://$http_host/docs/$1/release-notes/assemblyscript-migration-guide/ permanent;
57+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/create-subgraph-hosted/$ $scheme://$http_host/docs/$1/developing/creating-a-subgraph/ permanent;
58+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/define-subgraph-hosted/$ $scheme://$http_host/docs/$1/developing/defining-a-subgraph/ permanent;
59+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/deprecating-a-subgraph/$ $scheme://$http_host/docs/$1/managing/deprecating-a-subgraph/ permanent;
60+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/developer-faq/$ $scheme://$http_host/docs/$1/developing/developer-faqs/ permanent;
61+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/distributed-systems/$ $scheme://$http_host/docs/$1/querying/distributed-systems/ permanent;
62+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/graphql-api/$ $scheme://$http_host/docs/$1/querying/graphql-api/ permanent;
63+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/matchstick/$ $scheme://$http_host/docs/$1/developing/unit-testing-framework/ permanent;
64+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/publish-subgraph/$ $scheme://$http_host/docs/$1/publishing/publishing-a-subgraph/ permanent;
65+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/query-the-graph/$ $scheme://$http_host/docs/$1/querying/querying-the-graph/ permanent;
66+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/querying-best-practices/$ $scheme://$http_host/docs/$1/querying/querying-best-practices/ permanent;
67+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/querying-from-your-app/$ $scheme://$http_host/docs/$1/querying/querying-from-an-application/ permanent;
68+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/quick-start/$ $scheme://$http_host/docs/$1/cookbook/quick-start/ permanent;
69+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/subgraph-debug-forking/$ $scheme://$http_host/docs/$1/cookbook/subgraph-debug-forking/ permanent;
70+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/explorer/$ $scheme://$http_host/docs/$1/network/explorer/ permanent;
71+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/hosted-service/deploy-subgraph-hosted/$ $scheme://$http_host/docs/$1/deploying/deploying-a-subgraph-to-hosted/ permanent;
72+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/hosted-service/migrating-subgraph/$ $scheme://$http_host/docs/$1/cookbook/migrating-a-subgraph/ permanent;
73+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/hosted-service/query-hosted-service/$ $scheme://$http_host/docs/$1/querying/querying-the-hosted-service/ permanent;
74+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/hosted-service/what-is-hosted-service/$ $scheme://$http_host/docs/$1/deploying/hosted-service/ permanent;
75+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/indexing/$ $scheme://$http_host/docs/$1/network/indexing/ permanent;
76+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/billing/$ $scheme://$http_host/docs/$1/querying/billing/ permanent;
77+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/deploy-subgraph-studio/$ $scheme://$http_host/docs/$1/deploying/deploying-a-subgraph-to-studio/ permanent;
78+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/managing-api-keys/$ $scheme://$http_host/docs/$1/querying/managing-api-keys/ permanent;
79+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/multisig/$ $scheme://$http_host/docs/$1/cookbook/multisig/ permanent;
80+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/studio-faq/$ $scheme://$http_host/docs/$1/deploying/subgraph-studio-faqs/ permanent;
81+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/subgraph-studio/$ $scheme://$http_host/docs/$1/deploying/subgraph-studio/ permanent;
82+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/transferring-subgraph-ownership/$ $scheme://$http_host/docs/$1/managing/transferring-subgraph-ownership/ permanent;
83+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/supported-networks/arweave/$ $scheme://$http_host/docs/$1/cookbook/arweave/ permanent;
84+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/supported-networks/cosmos/$ $scheme://$http_host/docs/$1/cookbook/cosmos/ permanent;
85+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/supported-networks/near/$ $scheme://$http_host/docs/$1/cookbook/near/ permanent;
86+
5187
location / {
5288
try_files $uri $uri.html $uri/index.html =404;
5389

0 commit comments

Comments
 (0)