diff options
author | metamuffin <metamuffin@disroot.org> | 2022-08-30 00:03:37 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2022-08-30 00:03:37 +0200 |
commit | 525baabe876c047a7367dae1f954148a52f190bc (patch) | |
tree | 005981e4773197075a17cfc1729c08284492f0a2 /code/src/html.rs | |
parent | 9fba4dc45d7319d03584fe10ead95d0ff7974234 (diff) | |
download | metamuffin-blog-525baabe876c047a7367dae1f954148a52f190bc.tar metamuffin-blog-525baabe876c047a7367dae1f954148a52f190bc.tar.bz2 metamuffin-blog-525baabe876c047a7367dae1f954148a52f190bc.tar.zst |
code block formatting
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)) + ), ) } |