From 43b5151215b67b8f4c00937625eaa0df3a1452ae Mon Sep 17 00:00:00 2001 From: Uriel Date: Sat, 13 Dec 2008 16:58:08 +0100 Subject: [PATCH] Fix sortedBlogPostList to handle paths containing a '.', and strip the '/./' used as a sort delimiter from output --- bin/werc.rc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/werc.rc b/bin/werc.rc index b3804d0..cc94f4f 100755 --- 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 {