From 5c13375f554103c5a9cc78f902020744d35c24f2 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Thu, 22 Apr 2021 06:49:24 -0600 Subject: actually handle files who needs syntax highlighting and line numbers anyway --- src/templates.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/templates.rs') diff --git a/src/templates.rs b/src/templates.rs index 257c41e..f15046a 100644 --- a/src/templates.rs +++ b/src/templates.rs @@ -18,6 +18,14 @@ pub struct RepoFolder<'a> { pub tree: git2::Tree<'a>, } +#[derive(Template)] +#[template(path = "repo_file.html")] +pub struct RepoFile<'a> { + pub title: &'a str, + pub rel_path: &'a str, + pub blob: git2::Blob<'a>, +} + mod filters { pub fn from_utf8_lossy(utf8: &[u8]) -> ::askama::Result { Ok(String::from_utf8_lossy(utf8).into_owned()) -- cgit v1.2.3