Initial structure for rendering a blog post stream.
This commit is contained in:
46
src/context/blog_stream.rs
Normal file
46
src/context/blog_stream.rs
Normal file
@@ -0,0 +1,46 @@
|
||||
use std::path::Path;
|
||||
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::context::RenderDocumentElement;
|
||||
use crate::context::RenderRealFootnoteDefinition;
|
||||
use crate::error::CustomError;
|
||||
use crate::intermediate::BlogPost;
|
||||
|
||||
use super::GlobalSettings;
|
||||
use super::PageHeader;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename = "blog_stream")]
|
||||
pub(crate) struct RenderBlogStream {
|
||||
global_settings: GlobalSettings,
|
||||
page_header: Option<PageHeader>,
|
||||
children: Vec<RenderBlogStreamEntry>,
|
||||
older_link: Option<String>,
|
||||
newer_link: Option<String>,
|
||||
}
|
||||
|
||||
impl RenderBlogStream {
|
||||
pub(crate) fn new(
|
||||
config: &Config,
|
||||
output_directory: &Path,
|
||||
output_file: &Path,
|
||||
original: &Vec<BlogPost>,
|
||||
) -> Result<RenderBlogStream, CustomError> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub(crate) struct RenderBlogStreamEntry {
|
||||
/// The title that will be shown visibly on the page.
|
||||
title: Option<String>,
|
||||
|
||||
self_link: Option<String>,
|
||||
|
||||
children: Vec<RenderDocumentElement>,
|
||||
|
||||
footnotes: Vec<RenderRealFootnoteDefinition>,
|
||||
}
|
||||
@@ -2,6 +2,7 @@ mod angle_link;
|
||||
mod ast_node;
|
||||
mod babel_call;
|
||||
mod blog_post_page;
|
||||
mod blog_stream;
|
||||
mod bold;
|
||||
mod center_block;
|
||||
mod citation;
|
||||
|
||||
Reference in New Issue
Block a user