There is a (known now) bug in blagh: if link references are repeated
in different posts you won't get the links you expect in the main
page. The reason is all the posts in markdown format are concatenated
before being transformed to html. This patch tries to solve this
problem (and some problems of my previous fix, as discussed on irc). I
think it also makes a better use of fltr_cache. If the patch is finaly
applied feel free to rename the cat_post_list function to anything
better, and change the sed command to add the terminating slash to
whichever idiom is used in the rest of werc code.
--
- yiyus || JGL . 4l77.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"werc" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/werc9?hl=en
-~----------~----~----~----~------~----~------~--~---
diff -r 55d60f7ecc11 apps/blagh/app.rc
--- a/apps/blagh/app.rc Wed Sep 09 10:39:56 2009 +0200
+++ b/apps/blagh/app.rc Tue Nov 10 22:36:04 2009 +0100
@@ -72,13 +72,8 @@
echo '<div style="text-align:right">(<a href="index.rss">RSS Feed</a>|<a href="index.atom">Atom Feed</a>)</div>'
- { # 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
- echo # Needed extra \n so markdown doesn't mess up the formatting, probably can be done in sed.
- }
- } | $formatter
+ for(d in $blagh_dirs)
+ fltr_cache cat_post_list $blagh_root^`{echo $d | sed 's![^/]$!&/!'}
}
fn get_post_list {
@@ -87,6 +82,13 @@
ls -F $*^/./[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/ >[2]/dev/null | sed -n '/'^$forbidden_uri_chars^'/d; s,/\./,/|/,; /\/$/p' | sort -r '-t|' +1 | sed -e 's,/+\|/+,/,' -e $conf_max_posts_per_page^'q'
}
+fn cat_post_list {
+ for(p in `{get_post_list $1}) {
+ 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!'}
+ $formatter $p/index.md | sed '1s!>!><a href="'^$l(2)^'">!;1s!</[^<]+$!</a> ('^$l(1)^')&!'
+ }
+}
+
fn mkbpost {
bptext=$1
bpdate=$2