website/src/html/wiki.rs

39 lines
1.1 KiB
Rust
Raw Normal View History

2024-04-13 15:26:52 +02:00
use hypertext::{html_elements, maud_move, GlobalAttributes, Renderable};
use crate::md::Wiki;
use crate::html::page;
pub fn wiki<'data, 'html, T>(fm: &'data Wiki, content: T) -> impl Renderable + 'html
where
'data: 'html,
T: Renderable + 'data
{
let main = maud_move!(
main .wiki-main {
// Slide in/out for mobile
input #wiki-aside-shown type="checkbox" hidden;
aside .wiki-aside {
// Slide button
label .wiki-aside__slider for="wiki-aside-shown" {
img .wiki-icon src="/static/svg/double-arrow.svg" width="24" height="24";
}
// Navigation tree
// <Tree heading="Personal Wiki" pages={pages} headings={headings} />
}
article .wiki-article /*class:list={classlist)*/ {
header class="markdown" {
h1 #top { (fm.title.clone()) }
}
section .wiki-article__markdown.markdown {
(content)
}
}
}
);
page(&fm.title, main)
}