commit 9dae0dd2e17afe6c73938aef05c5efec92558e11
parent ab7ea620953fc99eadf3cd07490604258677f2da
Author: uriel@engel.se.cat-v.org <unknown>
Date: Sat, 13 Dec 2008 16:58:08 +0100
Fix sortedBlogPostList to handle paths containing a '.', and strip the '/./' used as a sort delimiter from output
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/bin/werc.rc b/bin/werc.rc
@@ -76,9 +76,10 @@ fn gensidebar {
}
fn sortedBlogPostList {
- # the /./ is added so we can sort -t. and order only the file name
+ # the /./->/|/ are added so we can sort -t| and order only the file name
+ # NOTE: this breaks if any path element in blogDirs contain '/./' or '|'
if (! ~ $#* 0)
- ls $*^'/./' | grep '/[0-9]+.*\.md$'| sort -r -t. +1
+ ls $*^'/./' | sed -n 's,/\./,/|/,; /\/[0-9]+.*\.md$/p' | sort -r '-t|' +1 | sed 's,/\|/,,'
}
fn gen_blog_post_title {