shithub: werc

Download patch

ref: 6ffde63aa99a7a2d95a3fdb958a873ba351ff197
parent: 89a5535257a66d98aa8acb2bbc4faecdb2a09e30
author: uriel <uriel@engel.se.cat-v.org>
date: Wed May 30 08:10:23 EDT 2007

Proper fix for the blog post sort issue

--- a/bin/controller.rc
+++ b/bin/controller.rc
@@ -109,7 +109,8 @@
     if ( ~ $blog 'yes' && ~ $body */index.md ) {
         if ( ! ~ $#blogTitle 0 )
             echo '<h1>'$"blogTitle'</h1>'
-        for ( i in `{ ls $blogDirs | grep '[0-9]+.*\.md$'| sort -r -t. +1  } ) {
+        # the /./ is added so we can sort -t. and order only the file name
+        for ( i in `{ ls $blogDirs^'/./' | grep '[0-9]+.*\.md$'| sort -r -t. +1  } ) {
             t=`{basename $i|sed -e 's/^[0-9\-]*_//' -e 's,\.md$,,' -e 's/_/ /g' }
             du=`{ls -l $i }
             #echo '<h2>' $"t '<small style="font-size: 70%">by '$"$du(4)' (Last mod: '$du(7) $du(8) $du(9)')</small></h2>'