dollgen 0.4.0

an unopinionated and extensible Static Site Generator, natively supporting liquid, markdoll, scss, and compiling rust to wasm
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use ::std::{
	ffi::OsStr,
	path::{Path, PathBuf},
};

#[allow(unused, reason = "used with some features")]
pub fn with_added_extension_but_stable(path: &Path, extension: impl AsRef<OsStr>) -> PathBuf {
	let mut new = path.extension().unwrap_or_default().to_os_string();
	if path.extension().is_some() {
		new.push(".");
	}
	new.push(extension);
	path.with_extension(new)
}