Created
May 21, 2018 08:26
-
-
Save anjandev/c517e79042148c136b98334867c545d8 to your computer and use it in GitHub Desktop.
http://werc.cat-v.org/apps/blagh/ patch link was broken. So I rewrote it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/apps/blagh/app.rc b/apps/blagh/app.rc | |
index 71bcef6..5707ccd 100644 | |
--- a/apps/blagh/app.rc | |
+++ b/apps/blagh/app.rc | |
@@ -10,6 +10,9 @@ fn conf_enable_blog { | |
if(~ $"conf_max_posts_per_page '') | |
conf_max_posts_per_page=32 | |
+ | |
+ if(~ $"conf_max_lines_per_post '') | |
+ conf_max_lines_per_post=10 | |
} | |
fn blagh_init { | |
@@ -77,7 +80,7 @@ fn blagh_body { | |
{ # XXX Not sure why this fixes issues with blog setup, probably bug in fltr_cache! | |
for(p in `{get_post_list $blagh_root^$blagh_dirs}) { | |
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 | |
+ sed '1s!.*^') ('^$l(1)^')!' < $p/index.md | head -n $conf_max_lines_per_post | |
echo # Needed extra \n so markdown doesn't mess up the formatting, probably can be done in sed. | |
} | |
# XXX BUG! Markdown [references] break because multiple markdown documents are merged. Should format each blog post independently. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment