bustdir 0.4.1

Read a directory and generate cache-busting hashes for it
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::BustDir;

/// This filter takes one argument of type `BustDir`.
#[askama::filter_fn]
pub fn bust_dir<T: std::fmt::Display>(
    path: T,
    _: &dyn askama::Values,
    bustdir: &BustDir,
) -> askama::Result<String> {
    let path = path.to_string();
    Ok(bustdir.get_or_random(&path).to_hex().to_string())
}