Update the dependency manager file stack when rendering blog post pages.

This commit is contained in:
Tom Alexander
2025-02-08 18:01:59 -05:00
parent 3867f965d2
commit 4e0f66401d
2 changed files with 89 additions and 58 deletions

View File

@@ -1,5 +1,7 @@
use std::path::PathBuf;
use crate::error::CustomError;
pub(crate) type RefDependencyManager = std::sync::Arc<std::sync::Mutex<DependencyManager>>;
#[derive(Debug)]
@@ -16,4 +18,19 @@ impl DependencyManager {
file_stack: Vec::new(),
}
}
pub(crate) fn push_file<P>(&mut self, path: P) -> Result<(), CustomError>
where
P: Into<PathBuf>,
{
self.file_stack.push(path.into());
Ok(())
}
pub(crate) fn pop_file(&mut self) -> Result<(), CustomError> {
self.file_stack
.pop()
.expect("Popped more files off the dependency manager file stack than exist.");
Ok(())
}
}