//! This module assembles and builds the website.

mod blog;
mod slides;
mod statics;

use std::path::Path;

use color_eyre::{eyre::Context, Result};

use crate::Config;

pub fn assemble_website(
    rng: &mut rand::rngs::StdRng,
    config: &Config,
    statics: &Path,
    root: &Path,
    dist: &Path,
) -> Result<()> {
    blog::build(&root.join("blog"), &dist.join("blog")).wrap_err("building blog")?;
    slides::build(
        &config.slides,
        &root.join("slides"),
        &dist.join("slides"),
    )
    .wrap_err("building slides")?;

    statics::build(rng, &config.slides, statics, dist).wrap_err("building root files")?;

    Ok(())
}

