aboutsummaryrefslogtreecommitdiff
path: root/src/templates.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-22 06:49:24 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-22 06:49:24 -0600
commit5c13375f554103c5a9cc78f902020744d35c24f2 (patch)
treef7fea5025f5952c4361b8354cccd7647de9ed4e3 /src/templates.rs
parent7620dd41ca41cf4fb445d6a6e9afe2607ed77a95 (diff)
downloadgityeet-5c13375f554103c5a9cc78f902020744d35c24f2.tar.gz
gityeet-5c13375f554103c5a9cc78f902020744d35c24f2.zip
actually handle files
who needs syntax highlighting and line numbers anyway
Diffstat (limited to 'src/templates.rs')
-rw-r--r--src/templates.rs8
1 files changed, 8 insertions, 0 deletions
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<String> {
Ok(String::from_utf8_lossy(utf8).into_owned())