1use std::collections::HashMap;
2
3use geoff_core::config::SiteConfig;
4use geoff_graph::store::ContentStore;
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct PageData {
10 pub path: String,
12 pub title: Option<String>,
14 pub content_type: Option<String>,
16 pub html: String,
18 pub raw_body: String,
20 pub frontmatter: HashMap<String, serde_json::Value>,
22}
23
24pub struct InitContext<'a> {
26 pub config: &'a SiteConfig,
27 pub plugin_options: &'a HashMap<String, toml::Value>,
28}
29
30pub struct BuildContext<'a> {
32 pub config: &'a SiteConfig,
33 pub store: &'a ContentStore,
34}
35
36pub struct ContentContext<'a> {
38 pub config: &'a SiteConfig,
39 pub page: &'a mut PageData,
40}
41
42pub struct GraphContext<'a> {
44 pub config: &'a SiteConfig,
45 pub store: &'a ContentStore,
46}
47
48pub struct ValidationContext<'a> {
50 pub config: &'a SiteConfig,
51 pub store: &'a ContentStore,
52 pub conforms: bool,
53 pub violations: usize,
54}
55
56pub struct RenderContext<'a> {
58 pub config: &'a SiteConfig,
59 pub store: &'a ContentStore,
60 pub page: &'a mut PageData,
61 pub extra_vars: &'a mut HashMap<String, serde_json::Value>,
63}
64
65pub struct OutputContext<'a> {
67 pub config: &'a SiteConfig,
68 pub store: &'a ContentStore,
69 pub outputs: &'a HashMap<String, String>,
71 pub output_dir: &'a camino::Utf8Path,
73}
74
75pub struct WatchContext<'a> {
77 pub config: &'a SiteConfig,
78 pub changed_path: &'a str,
79}