aboutsummaryrefslogtreecommitdiff
path: root/src/file_handler/file_strategies/layout.rs
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2023-04-15 16:39:12 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2023-04-15 16:39:12 +0200
commit102a4884c3d7d26817fefb38c675be07047f5ee2 (patch)
tree6187c05ac190c210310a4b0f18e37d0ea82ca423 /src/file_handler/file_strategies/layout.rs
parent1e2d00b62ecce95f71d4bfd60a043c8e86631eee (diff)
Add basic strategies
Diffstat (limited to 'src/file_handler/file_strategies/layout.rs')
-rw-r--r--src/file_handler/file_strategies/layout.rs24
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())
+ }
+}
+