+ pub fn get_layout_or_panic(&mut self, files: &Vec<File>) -> Result<(), &str> {
+ for file in files {
+ match file.file_type {
+ FileType::Layout => {
+ let layout_text = read_to_string(&file.path).unwrap();
+ self.layout = Some(layout_text);
+ return Ok(());
+ },
+ _ => {}
+ }
+ }
+ Err("No layout found. Please ensure there's a _layout.html file at the root")
+ }
+
+ pub fn handle_all(&self, source: &PathBuf, html_destination: &PathBuf, gemini_destination: &PathBuf, files: &Vec<File>) {
+ for file in files {
+ self.handle(source, html_destination, gemini_destination, file);
+ }
+ }
+
+ pub fn handle(&self, source: &PathBuf, html_destination: &PathBuf, gemini_destination: &PathBuf, file: &File) {