diff --git a/src/site.rs b/src/site.rs index e26610b..11117d7 100644 --- a/src/site.rs +++ b/src/site.rs @@ -106,7 +106,8 @@ impl Resource for ArticleResource { created: &'a chrono::DateTime, title: &'a str, - body: String, + raw: &'a str, + rendered: String, } self.head().map(move |head| @@ -118,7 +119,8 @@ impl Resource for ArticleResource { revision: self.data.revision, created: &Local.from_utc_datetime(&self.data.created), title: &self.data.title, - body: render_markdown(&self.data.body), + raw: &self.data.body, + rendered: render_markdown(&self.data.body), } }.to_string()) ).boxed() diff --git a/templates/article_revision.html b/templates/article_revision.html index 619388c..fb41bde 100644 --- a/templates/article_revision.html +++ b/templates/article_revision.html @@ -3,10 +3,20 @@
-{{{body}}} +
+{{{rendered}}} +
+
+
+ + + +
+
+ + diff --git a/templates/layout.html b/templates/layout.html index b40bcc8..4fc6f99 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -90,6 +90,7 @@ article { footer { + padding: 16px 0; background: #f8f8f8; color: #444; text-align: center; @@ -99,6 +100,10 @@ footer { "Droid Sans", "Helvetica Neue", sans-serif; } +footer dl { + margin: 0; +} + footer dt, footer dd { display: inline; margin: 0; @@ -119,6 +124,29 @@ footer dd:last-child::after { margin: 0; } +textarea { + border: none; + background: none; + margin: 0; + padding: 0; + font-family: "SF Mono", "Monaco", + "Inconsolata", "Fira Mono", + "Droid Sans Mono", "Source Code Pro", + monospace; + + width: 100%; + height: 1000px; +} + +.editor { + display: none; +} + +button[type="submit"] { + position: fixed; + right: 20px; + bottom: 20px; +}