Skip to main content

pebble_cms/cli/
rerender.rs

1use anyhow::Result;
2use std::path::Path;
3
4use crate::services::content::rerender_all_content;
5use crate::{Config, Database};
6
7pub async fn run(config_path: &Path) -> Result<()> {
8    let config = Config::load(config_path)?;
9    let db = Database::open(&config.database.path)?;
10
11    println!("Re-rendering all content...");
12    let count = rerender_all_content(&db)?;
13    println!("Successfully re-rendered {} content items.", count);
14
15    Ok(())
16}