@@ -46,6 +46,7 @@ module Category = {
4646}
4747
4848type item = {
49+ id : string ,
4950 keywords : array <string >,
5051 name : string ,
5152 summary : string ,
@@ -55,27 +56,31 @@ type item = {
5556
5657let allItems = [
5758 {
59+ id : "module-decorator" ,
5860 keywords : ["@bs.module" ],
5961 name : "@module" ,
6062 summary : "This is the `@module` decorator." ,
6163 category : Decorators ,
6264 component : decorator_module ,
6365 },
6466 {
67+ id : "as-decorator" ,
6568 keywords : ["@bs.as" ],
6669 name : "@as" ,
6770 summary : "This is the `@as` decorator." ,
6871 category : Decorators ,
6972 component : decorator_as ,
7073 },
7174 {
75+ id : "if-else" ,
7276 keywords : ["if" , "else" , "if else" ],
7377 name : "if / else" ,
7478 summary : "This is the `if / else` control flow structure." ,
7579 category : ControlFlow ,
7680 component : controlflow_ifelse ,
7781 },
7882 {
83+ id : "uncurried-function" ,
7984 keywords : ["uncurried" ],
8085 name : "(.) => {}" ,
8186 summary : "This is an `uncurried` function." ,
@@ -152,7 +157,7 @@ let make = () => {
152157 switch getAnchor (router .asPath ) {
153158 | Some (anchor ) =>
154159 Js .Array2 .find (allItems , item =>
155- GithubSlugger .slug (item .name ) === anchor
160+ GithubSlugger .slug (item .id ) === anchor
156161 )-> Belt .Option .forEach (item => {
157162 setState (_ => ShowDetails (item ))
158163 })
@@ -172,15 +177,15 @@ let make = () => {
172177 React .useEffect1 (() => {
173178 switch (state , getAnchor (router .asPath )) {
174179 | (ShowDetails (item ), Some (anchor )) =>
175- let slug = GithubSlugger .slug (item .name )
180+ let slug = GithubSlugger .slug (item .id )
176181
177182 if slug !== anchor {
178183 router -> Next .Router .replace ("syntax-lookup#" ++ anchor )
179184 } else {
180185 ()
181186 }
182187 | (ShowDetails (item ), None ) =>
183- router -> Next .Router .replace ("syntax-lookup#" ++ GithubSlugger .slug (item .name ))
188+ router -> Next .Router .replace ("syntax-lookup#" ++ GithubSlugger .slug (item .id ))
184189 | (_ , Some (_ )) => router -> Next .Router .replace ("syntax-lookup" )
185190 | _ => ()
186191 }
0 commit comments