Skip to main content

depgraph_cache_root

Function depgraph_cache_root 

Source
pub fn depgraph_cache_root(site_dir: &Path) -> PathBuf
Expand description

Resolves the on-disk cache root for the persisted dependency graph.

Issue #524 specifies target/ssg-cache/; when no target/ directory is available (e.g. tests or sites built outside cargo), the cache lives at <site_dir>/.ssg-cache/.

ยงExamples

use ssg::pipeline::depgraph_cache_root;
use std::path::Path;

let cache_root = depgraph_cache_root(Path::new("/tmp/site"));
assert!(cache_root.exists() || cache_root.ends_with(".ssg-cache") || cache_root.ends_with("ssg-cache"));