From 1c47df37c56da0ec30920ac98eb0d15c213ffd4c Mon Sep 17 00:00:00 2001
From: Till Hoeppner
Date: Sun, 30 Nov 2014 00:32:47 +0100
Subject: Optimised default template
---
src/constants.rs | 125 ++++++++++++++++++++++++++++---------------------------
src/sersve.rs | 2 +-
2 files changed, 65 insertions(+), 62 deletions(-)
(limited to 'src')
diff --git a/src/constants.rs b/src/constants.rs
index 3f54284..351ba5f 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -1,107 +1,110 @@
+pub const OPT_TEMPLATE: &'static str =
+"
{{title}} {{title}}
Name | Size |
{{#content}} {{name}} | {{size}} |
{{/content}}
";
+
pub const TEMPLATE: &'static str =
"
- {{title}}
-
-
-
-
{{title}}
-
-
-
- Name |
- Size |
-
-
-
- {{#content}}
-
-
- {{name}}
- |
-
- {{size}}
- |
-
- {{/content}}
-
-
-
-
+
+
+
+
{{title}}
+
+
+
+ Name |
+ Size |
+
+
+
+ {{#content}}
+
+
+ {{name}}
+ |
+
+ {{size}}
+ |
+
+ {{/content}}
+
+
+
+
";
diff --git a/src/sersve.rs b/src/sersve.rs
index 203bab4..da8ffe2 100644
--- a/src/sersve.rs
+++ b/src/sersve.rs
@@ -264,7 +264,7 @@ fn main() {
options.port.clone().unwrap_or(8080))
};
- let template = mustache::compile_str(options.template.clone().unwrap_or(constants::TEMPLATE.into_string())[]);
+ let template = mustache::compile_str(options.template.clone().unwrap_or(constants::OPT_TEMPLATE.into_string())[]);
let state = State {
template: template
};
--
cgit v1.2.3