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 {