From 820c8544359ebb7116ec213a4768a8d4b418e288 Mon Sep 17 00:00:00 2001 From: TrialDragon Date: Fri, 8 Mar 2024 15:09:35 -0800 Subject: [PATCH] Add better solution --- tools/example-showcase/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/example-showcase/src/main.rs b/tools/example-showcase/src/main.rs index cabdd973f2a7e..ca26156b2b1c0 100644 --- a/tools/example-showcase/src/main.rs +++ b/tools/example-showcase/src/main.rs @@ -464,7 +464,7 @@ header_message = \"Examples (WebGL2)\" if !to_show.wasm { continue; } - let category_path = root_path.join(&to_show.category); + let category_path = root_path.join(&to_show.category.replace(['(', ')'], "").replace(' ', "-").to_lowercase()); if !categories.contains_key(&to_show.category) { let _ = fs::create_dir_all(&category_path); @@ -500,6 +500,7 @@ title = \"{}\" template = \"example{}.html\" weight = {} description = \"{}\" +aliases = [\"/examples{}/{}/{}\"] [extra] technical_name = \"{}\" @@ -516,6 +517,12 @@ header_message = \"Examples ({})\" }, categories.get(&to_show.category).unwrap(), to_show.description.replace('"', "'"), + match api { + WebApi::Webgpu => "-webgpu", + WebApi::Webgl2 => "", + }, + to_show.category, + &to_show.technical_name.replace('_', "-"), &to_show.technical_name.replace('_', "-"), match api { WebApi::Webgpu => "-webgpu",