Skip to main content

execute_build_pipeline_with

Function execute_build_pipeline_with 

Source
pub fn execute_build_pipeline_with(
    plugins: &PluginManager,
    ctx: &PluginContext,
    build_dir: &Path,
    content_dir: &Path,
    site_dir: &Path,
    template_dir: &Path,
    quiet: bool,
    incremental: bool,
) -> Result<(), SsgError>
Expand description

Variant of execute_build_pipeline that accepts the --incremental flag.

When incremental is true and the persisted dependency graph at <cache_root>/depgraph.json shows no source-side changes, the full compile + transform passes are skipped — the site on disk from the previous build is the authoritative output. When sources did change, the full compile runs but the resulting graph is persisted with fresh sha256 freshness keys so the next incremental invocation can short-circuit.

The cache root is <build_dir>/../target/ssg-cache/ when build_dir is a sibling of target/; otherwise it lives directly under <site_dir>/.ssg-cache/. The chosen path is logged.

§Examples

use ssg::cmd::SsgConfig;
use ssg::pipeline::{build_pipeline, execute_build_pipeline_with, RunOptions};

let cfg = SsgConfig::default();
let opts = RunOptions::default();
let (plugins, ctx, build, site) = build_pipeline(&cfg, &opts);
let _ = execute_build_pipeline_with(
    &plugins, &ctx, &build, &cfg.content_dir, &site, &cfg.template_dir,
    true, false,
);