Initial structure for rendering a blog post stream.

This commit is contained in:
Tom Alexander
2023-12-17 15:23:40 -05:00
parent 60555999db
commit e8ed4a4f4a
4 changed files with 61 additions and 0 deletions

View File

@@ -89,6 +89,19 @@ impl SiteRenderer {
Ok(())
}
pub(crate) async fn render_blog_stream(&self, config: &Config) -> Result<(), CustomError> {
// TODO: Actually render a blog stream to index.html
// Steps: sort blog posts by date, newest first
//
// Steps: group blog posts based on # of posts per page
//
// Steps: for each group, create a RenderBlogStream
//
// Steps: pass each RenderBlogStream to dust as the context to render index.html and any additional stream pages.
Ok(())
}
pub(crate) async fn render_stylesheets(&self) -> Result<(), CustomError> {
let stylesheet_output_directory = self.output_directory.join("stylesheet");
if !stylesheet_output_directory.exists() {

View File

@@ -23,6 +23,7 @@ pub(crate) async fn build_site(args: BuildArgs) -> Result<(), CustomError> {
stylesheets,
);
renderer.render_blog_posts(&config).await?;
renderer.render_blog_stream(&config).await?;
renderer.render_stylesheets().await?;
Ok(())