add: allow lisp templates (bberry)

This commit is contained in:
trisua 2025-05-30 21:22:53 -04:00
parent 8de5c0ea76
commit 78d0766345
10 changed files with 296 additions and 263 deletions

View file

@ -7,7 +7,15 @@ macro_rules! write_template {
($into:ident->$path:literal($as:expr) --config=$config:ident) => {
std::fs::write(
$into.join($path),
$crate::assets::replace_in_html($as, &$config).await,
$crate::assets::replace_in_html($as, &$config, false).await,
)
.unwrap();
};
($into:ident->$path:literal($as:expr) --config=$config:ident --lisp) => {
std::fs::write(
$into.join($path),
$crate::assets::replace_in_html($as, &$config, true).await,
)
.unwrap();
};
@ -29,7 +37,20 @@ macro_rules! write_template {
std::fs::write(
$into.join($path),
$crate::assets::replace_in_html($as, &$config).await,
$crate::assets::replace_in_html($as, &$config, false).await,
)
.unwrap();
};
($into:ident->$path:literal($as:expr) -d $dir_path:literal --config=$config:ident --lisp) => {
let dir = $into.join($dir_path);
if !std::fs::exists(&dir).unwrap() {
std::fs::create_dir(dir).unwrap();
}
std::fs::write(
$into.join($path),
$crate::assets::replace_in_html($as, &$config, true).await,
)
.unwrap();
};