diff options
Diffstat (limited to 'code/src/html.rs')
-rw-r--r-- | code/src/html.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/code/src/html.rs b/code/src/html.rs index 64b4c6d..e53502f 100644 --- a/code/src/html.rs +++ b/code/src/html.rs @@ -1,5 +1,5 @@ -use crate::{article_metadata, get_articles, markdown::blocks_to_html, ArticleMeta}; -use laby::{html, iter, li, ul, Render}; +use crate::{article_metadata, file_history, get_articles, markdown::blocks_to_html, ArticleMeta}; +use laby::{frag, html, iter, li, ul, Render}; use std::fs::read_to_string; pub fn scaffold(title: String, body: impl Render) -> impl Render { @@ -24,9 +24,14 @@ pub fn scaffold(title: String, body: impl Render) -> impl Render { pub fn article(path: String) -> impl Render { scaffold( article_metadata(path.clone().into()).title, - laby::raw!(blocks_to_html(markdown::tokenize( - &read_to_string(path).unwrap() - ))), + frag!( + laby::raw!(blocks_to_html(markdown::tokenize( + &read_to_string(&path).unwrap() + ))), + hr!(), + p!("changes to this article (as recorded with git; visible on the git repo, that i will create soon)"), + pre!(file_history(&path)) + ), ) } |