1use std::fmt;
18
19use crate::render::Gazetta;
20
21mod index;
22mod page;
23mod site;
24
25pub use self::index::{Index, Paginate};
26pub use self::page::{Content, Page};
27pub use self::site::Site;
28
29pub struct Context<'a, G>
30where
31 G: Gazetta,
32{
33 pub page: &'a Page<'a, G>,
34 pub site: &'a Site<'a, G>,
35}
36
37impl<'a, G> Copy for Context<'a, G>
38where
39 G: Gazetta + 'a,
40 G::PageMeta: 'a,
41 G::SiteMeta: 'a,
42{
43}
44
45impl<'a, G> Clone for Context<'a, G>
46where
47 G: Gazetta + 'a,
48 G::PageMeta: 'a,
49 G::SiteMeta: 'a,
50{
51 fn clone(&self) -> Self {
52 *self
53 }
54}
55
56impl<'a, G> fmt::Debug for Context<'a, G>
57where
58 G: Gazetta + 'a,
59 G::PageMeta: fmt::Debug + 'a,
60 G::SiteMeta: fmt::Debug + 'a,
61{
62 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
63 f.debug_struct("Context")
64 .field("site", &self.site)
65 .field("page", &self.page)
66 .finish()
67 }
68}