diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-04-15 16:39:12 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-04-15 16:39:12 +0200 |
| commit | 102a4884c3d7d26817fefb38c675be07047f5ee2 (patch) | |
| tree | 6187c05ac190c210310a4b0f18e37d0ea82ca423 /src/file_handler/file_strategies/layout.rs | |
| parent | 1e2d00b62ecce95f71d4bfd60a043c8e86631eee (diff) | |
Add basic strategies
Diffstat (limited to 'src/file_handler/file_strategies/layout.rs')
| -rw-r--r-- | src/file_handler/file_strategies/layout.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/file_handler/file_strategies/layout.rs b/src/file_handler/file_strategies/layout.rs index e69de29..cf1bb9f 100644 --- a/src/file_handler/file_strategies/layout.rs +++ b/src/file_handler/file_strategies/layout.rs @@ -0,0 +1,24 @@ +pub struct Strategy {} + +use std::path::PathBuf; + +use crate::file_handler::{FileType, FileHandlerStrategy}; + +impl FileHandlerStrategy for Strategy { + fn is(&self, path: &PathBuf) -> bool { + return !path.is_dir() && path.ends_with("_layout.html"); + } + + fn identify(&self) -> FileType { + FileType::Layout + } + + fn can_handle(&self, path: &PathBuf) -> bool { + self.is(path) + } + + fn handle(&self, path: &PathBuf) { + println!("Should convert {}", path.display()) + } +} + |