Add Support for Subcategories in Guide#84
Add Support for Subcategories in Guide#84ElijahAhianyo wants to merge 11 commits intocot-rs:masterfrom
Conversation
|
Depends on #82 |
| /// A subcategory containing a collection of related pages. | ||
| /// | ||
| /// # Examples | ||
| /// ```ignore |
There was a problem hiding this comment.
ignore here because the md_page macro will try to read the guides which we dont want
| } | ||
|
|
||
| #[derive(Debug, Clone)] | ||
| enum GuideCategoryItem { |
There was a problem hiding this comment.
I wonder if GuideCategoryItem could be merged with GuideItem as they seem almost the same. Why did you decide to split them? 🤔
There was a problem hiding this comment.
I don't think they serve the same purpose, per se. The previous version of CotApp::new accepted MdPage, which was a public-facing representation of a page. When parsing the guide(cot_site::guides::parse_guides), we convert that to MdPageLink(almost similar signature as MdPage), which is an internal representation of the page that gets rendered in the template.
This change also follows the same concept/design; GuideItem is public-facing, whereas GuideCategoryItem is an internal representation of MdPageLink(s) that get rendered in the template
With this you should be able to add nested subcategories like this:
Refer to the sidebar in this image(cot-rs/cot#515 (comment)) on how this renders