# HG changeset patch # User Steve Kemp # Date 1228849094 0 # Node ID 644ba9f3ffd2e6fead83ac689e21a6914c4bfd1c # Parent 7dd1318c86526d3336e8da081c70098bb044635b Added --recent-dates-first + --recent-tags-first diff -r 7dd1318c8652 -r 644ba9f3ffd2 bin/chronicle --- a/bin/chronicle Tue Dec 09 18:05:55 2008 +0000 +++ b/bin/chronicle Tue Dec 09 18:58:14 2008 +0000 @@ -30,6 +30,11 @@ --pre-build Specify a command to execute prior to building the blog. --post-build Specify a command to execute once the blog has been built. + Sorting Options: + + --recent-dates-first Show recent entries first in the archive view. + --recent-tags-first Show recent entries first in the tag view. + Optional Features: --force Force the copying of static files from the blog theme. @@ -548,6 +553,10 @@ "lower-case", \$CONFIG{ 'lower-case' }, "comment-days=s", \$CONFIG{ 'comment-days' }, + # sorting + "recent-tags-first", \$CONFIG{'recent-tags-first'}, + "recent-dates-first", \$CONFIG{'recent-dates-first'}, + # input format. "format=s", \$CONFIG{ 'format' }, "charset=s", \$CONFIG{ 'charset' }, @@ -1049,7 +1058,16 @@ # # Sort the entries by date # - my @sortedEntries = reverse sort bywhen @$entries; + my @sortedEntries; + + if ( $CONFIG{'recent-tags-first'} ) + { + @sortedEntries = sort bywhen @$entries; + } + else + { + @sortedEntries = reverse sort bywhen @$entries; + } # # Now write the output as a HTML page. @@ -1198,7 +1216,16 @@ # # Sort the entries by date # - my @sortedEntries = reverse sort bywhen @$entries; + my @sortedEntries; + if ( $CONFIG{'recent-dates-first'} ) + { + @sortedEntries = sort bywhen @$entries; + } + else + { + @sortedEntries = reverse sort bywhen @$entries; + } + # # Now write the output as a HTML page.