diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index a1b38f6..0a62ec2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -247,6 +247,18 @@ pub struct SourceFile { pub headings: Vec<String>, } +impl SourceFile { + pub fn back_string(&self) -> String { + let mut back = String::new(); + for c in self.full_url.chars() { + if c == '/' { + back.push_str("../"); + } + } + return back; + } +} + pub struct StaticFile { pub full_url: String, // URL full path, with extension pub source_path: PathBuf, |