commit 982acb340fc3962660412750266935544144a406
parent c0aaa9c8857de564a6c9d2c8337302feb0b9474e
Author: NunoSempere <nuno.sempere@protonmail.com>
Date: Thu, 10 Mar 2022 14:53:16 +0000
tweak: Give a preview of posts in main page
rather than pasting them all together.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/apps/blagh/app.rc b/apps/blagh/app.rc
@@ -83,7 +83,8 @@ fn blagh_body {
l=`{echo -n $p|sed 's!'$sitedir^'/?(.*)([0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9])(/[^/]+/)!\2 /\1\2\3!'}
sed '1s!.*^') ('^$l(1)^')!' < $p/index.md
echo # Needed extra \n so markdown doesn't mess up the formatting, probably can be done in sed.
- } | $formatter
+ } head -n 9 | $formatter | sed 's/h[2-9]/i/g'| sed 's/h1/h3/g'
+ # ^ take the first 9 lines of markdown, convert them to html. Then make h1->h3 and h_i -> cursive. This makes it more like a preview rather than all the posts pasted together.
# XXX BUG! Markdown [references] break because multiple markdown documents are merged. Should format each blog post independently.
# TODO: use fltr_cache directly, that can fix the previous bug plus provide a perf boost by caching title generation.
}