Fix sortedBlogPostList to handle paths containing a '.', and strip the '/./' used as a sort delimiter from output

This commit is contained in:
Uriel 2008-12-13 16:58:08 +01:00
parent 2a9dbdbfe9
commit 43b5151215

View file

@ -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 {