Move the render context to its own folder.
We are going to have a lot of render context types because there are so many org-mode elements/objects so I'm moving it to a separate folder for organization.
This commit is contained in:
parent
448e9bb8c6
commit
3cfcae25a9
@ -4,9 +4,9 @@ use std::path::PathBuf;
|
|||||||
|
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
|
use crate::types::GlobalSettings;
|
||||||
|
use crate::types::RenderBlogPostPage;
|
||||||
|
|
||||||
use super::render_context::GlobalSettings;
|
|
||||||
use super::render_context::RenderBlogPostPage;
|
|
||||||
use super::BlogPost;
|
use super::BlogPost;
|
||||||
use super::BlogPostPage;
|
use super::BlogPostPage;
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
mod convert;
|
mod convert;
|
||||||
mod definition;
|
mod definition;
|
||||||
mod page;
|
mod page;
|
||||||
mod render_context;
|
|
||||||
pub(crate) use convert::convert_blog_post_page_to_render_context;
|
pub(crate) use convert::convert_blog_post_page_to_render_context;
|
||||||
pub(crate) use definition::BlogPost;
|
pub(crate) use definition::BlogPost;
|
||||||
pub(crate) use page::BlogPostPage;
|
pub(crate) use page::BlogPostPage;
|
||||||
|
@ -13,6 +13,7 @@ mod command;
|
|||||||
mod config;
|
mod config;
|
||||||
mod error;
|
mod error;
|
||||||
mod render;
|
mod render;
|
||||||
|
mod types;
|
||||||
|
|
||||||
fn main() -> Result<ExitCode, CustomError> {
|
fn main() -> Result<ExitCode, CustomError> {
|
||||||
let rt = tokio::runtime::Runtime::new()?;
|
let rt = tokio::runtime::Runtime::new()?;
|
||||||
|
@ -1,27 +1,6 @@
|
|||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
/// The settings that a "global" to a single dustjs render.
|
use super::GlobalSettings;
|
||||||
#[derive(Debug, Serialize)]
|
|
||||||
pub(crate) struct GlobalSettings {
|
|
||||||
/// The title that goes in the html <title> tag in the <head>.
|
|
||||||
page_title: Option<String>,
|
|
||||||
css_files: Vec<String>,
|
|
||||||
js_files: Vec<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl GlobalSettings {
|
|
||||||
pub(crate) fn new(
|
|
||||||
page_title: Option<String>,
|
|
||||||
css_files: Vec<String>,
|
|
||||||
js_files: Vec<String>,
|
|
||||||
) -> GlobalSettings {
|
|
||||||
GlobalSettings {
|
|
||||||
page_title,
|
|
||||||
css_files,
|
|
||||||
js_files,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
24
src/types/global_settings.rs
Normal file
24
src/types/global_settings.rs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
|
/// The settings that a "global" to a single dustjs render.
|
||||||
|
#[derive(Debug, Serialize)]
|
||||||
|
pub(crate) struct GlobalSettings {
|
||||||
|
/// The title that goes in the html <title> tag in the <head>.
|
||||||
|
page_title: Option<String>,
|
||||||
|
css_files: Vec<String>,
|
||||||
|
js_files: Vec<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl GlobalSettings {
|
||||||
|
pub(crate) fn new(
|
||||||
|
page_title: Option<String>,
|
||||||
|
css_files: Vec<String>,
|
||||||
|
js_files: Vec<String>,
|
||||||
|
) -> GlobalSettings {
|
||||||
|
GlobalSettings {
|
||||||
|
page_title,
|
||||||
|
css_files,
|
||||||
|
js_files,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
5
src/types/mod.rs
Normal file
5
src/types/mod.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
mod blog_post_page;
|
||||||
|
mod global_settings;
|
||||||
|
|
||||||
|
pub(crate) use blog_post_page::RenderBlogPostPage;
|
||||||
|
pub(crate) use global_settings::GlobalSettings;
|
Loading…
x
Reference in New Issue
Block a user