(slug: &str)
| 517 | } |
| 518 | |
| 519 | fn route_path(collection: &str, slug: &str) -> String { |
| 520 | match (collection, slug) { |
| 521 | ("book", "index") => "/book".to_string(), |
| 522 | ("book", slug) if slug.ends_with("/index") => { |
| 523 | format!("/book/{}", slug.trim_end_matches("/index")) |
| 524 | } |
| 525 | ("book", slug) => format!("/book/{slug}"), |
| 526 | ("docs", "index") => "/docs".to_string(), |
| 527 | ("docs", slug) if slug.ends_with("/index") => { |