]> git.r.bdr.sh - rbdr/page/blame - src/file_handler/file_strategies/layout.rs
Wrap headings, fix empty lines
[rbdr/page] / src / file_handler / file_strategies / layout.rs
CommitLineData
102a4884
RBR
1pub struct Strategy {}
2
3use std::path::PathBuf;
4
4fd89b80 5use crate::file_handler::{File, FileType, FileHandlerStrategy};
102a4884
RBR
6
7impl FileHandlerStrategy for Strategy {
8 fn is(&self, path: &PathBuf) -> bool {
9 return !path.is_dir() && path.ends_with("_layout.html");
10 }
11
12 fn identify(&self) -> FileType {
13 FileType::Layout
14 }
15
4fd89b80
RBR
16 fn can_handle(&self, file_type: &FileType) -> bool {
17 match file_type {
18 FileType::Layout => true,
19 _ => false,
20 }
102a4884
RBR
21 }
22
ea529736
RBR
23 // We don't implement handling for layout, as we assume there's only one
24 // and it got handled before.
dd0a540c
RBR
25 fn handle_html(&self, _s: &PathBuf, _d: &PathBuf, _f: &File, _l: &String) {}
26 fn handle_gemini(&self, _s: &PathBuf, _d: &PathBuf, _f: &File) {}
102a4884 27}