@@ -28,6 +28,8 @@ pub fn sidebar(slug: &str, group: Option<&str>, locale: Locale) -> Result<MetaSi
28
28
Cow :: Borrowed ( l10n_json_data ( "Common" , "Related_pages_wo_group" , locale) ?)
29
29
} ;
30
30
let events_label = l10n_json_data ( "Common" , "Events" , locale) ?;
31
+ let guides_label = l10n_json_data ( "Common" , "Guides" , locale) ?;
32
+ let tutorial_label = l10n_json_data ( "Common" , "Tutorial" , locale) ?;
31
33
32
34
let main_if = slug
33
35
. strip_prefix ( "Web/API/" )
@@ -119,6 +121,23 @@ pub fn sidebar(slug: &str, group: Option<&str>, locale: Locale) -> Result<MetaSi
119
121
build_interface_list ( & mut entries, & inherited, inheritance_label) ;
120
122
build_interface_list ( & mut entries, & related, & related_label) ;
121
123
124
+ if let Some ( groups) = web_api_groups {
125
+ let guides: Vec < Page > = groups
126
+ . guides
127
+ . iter ( )
128
+ . filter_map ( |slug| slug. strip_prefix ( "/docs/" ) )
129
+ . filter_map ( |slug| Doc :: page_from_slug ( slug, locale, true ) . ok ( ) )
130
+ . collect ( ) ;
131
+ let tutorial: Vec < Page > = groups
132
+ . tutorial
133
+ . iter ( )
134
+ . filter_map ( |slug| slug. strip_prefix ( "/docs/" ) )
135
+ . filter_map ( |slug| Doc :: page_from_slug ( slug, locale, true ) . ok ( ) )
136
+ . collect ( ) ;
137
+ build_sublist ( & mut entries, & guides, guides_label) ;
138
+ build_sublist ( & mut entries, & tutorial, tutorial_label) ;
139
+ }
140
+
122
141
Ok ( MetaSidebar {
123
142
entries,
124
143
..Default :: default ( )
0 commit comments