MCPcopy Create free account
hub / github.com/PerroEngine/Perro / DocArticle

Function DocArticle

perro_website/src/pages/docs.rs:170–200  ·  view source on GitHub ↗
(doc: &'static crate::docs::DocPage, canonical_path: String)

Source from the content-addressed store, hash-verified

168 </PageFrame>
169 }
170}
171
172#[component]
173fn DocArticle(doc: &'static crate::docs::DocPage, canonical_path: String) -> impl IntoView {
174 let groups = docs_by_nav_group();
175 let group_pages = grouped_docs_filtered_for_nav("", Some(doc.nav_group.as_str()))
176 .into_iter()
177 .flat_map(|(_, pages)| pages)
178 .collect::<Vec<_>>();
179 let (prev, next) = docs_nav_neighbors(doc);
180 view! {
181 <Seo info=doc_seo(doc, &canonical_path) />
182 <PageFrame eyebrow=doc.nav_group.as_str() title=doc.title.as_str()>
183 <div class="doc-layout">
184 <aside class="doc-filter">
185 <h2>"Explore"</h2>
186 <a href="/docs"><span>"All"</span><small>{docs_pages().len()}</small></a>
187 {groups.into_iter().map(|(group, count)| {
188 let href = format!("/docs?group={group}");
189 view! {
190 <a href=href><span>{group}</span><small>{count}</small></a>
191 }
192 }).collect_view()}
193 <div class="doc-filter-pages">
194 <strong>{doc.nav_group.as_str()}</strong>
195 {group_pages.into_iter().map(|page| {
196 let class_name = if page.slug == doc.slug {
197 "current"
198 } else {
199 ""
200 };
201 let current = (page.slug == doc.slug).then_some("page");
202 view! {
203 <a class=class_name aria-current=current href=page.route_path.as_str()>

Callers

nothing calls this directly

Calls 1

docs_by_areaFunction · 0.85

Tested by

no test coverage detected