From c84fcdd32aad7a613bf7bbb501362dffcf5ccdeb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Dec 2008 01:52:08 -0500 Subject: [PATCH] meta: Process meta date during scan pass so that the date will always affect sorting in inlines. --- IkiWiki/Plugin/meta.pm | 16 ++++++++-------- debian/changelog | 2 ++ .../inline_sort_order_and_meta_date_value.mdwn | 2 ++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index ea60be507..8c214139f 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -121,6 +121,13 @@ sub preprocess (@) { $pagestate{$page}{meta}{authorurl}=$value if safeurl($value); # fallthrough } + elsif ($key eq 'date') { + eval q{use Date::Parse}; + if (! $@) { + my $time = str2time($value); + $IkiWiki::pagectime{$page}=$time if defined $time; + } + } if (! defined wantarray) { # avoid collecting duplicate data during scan pass @@ -128,14 +135,7 @@ sub preprocess (@) { } # Metadata collection that happens only during preprocessing pass. - if ($key eq 'date') { - eval q{use Date::Parse}; - if (! $@) { - my $time = str2time($value); - $IkiWiki::pagectime{$page}=$time if defined $time; - } - } - elsif ($key eq 'permalink') { + if ($key eq 'permalink') { if (safeurl($value)) { $pagestate{$page}{meta}{permalink}=$value; push @{$metaheaders{$page}}, scrub('', $destpage); diff --git a/debian/changelog b/debian/changelog index d8685db09..056fabc7d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,8 @@ ikiwiki (2.71) UNRELEASED; urgency=low * aggregate: If a feed fails to be downloaded, try again immediatly next time aggregation is run, even if the usual time has not passed. Closes: #508622 (Michael Gold) + * meta: Process meta date during scan pass so that the date will always + affect sorting in inlines. -- Joey Hess Mon, 17 Nov 2008 14:02:10 -0500 diff --git a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn index 219657753..d4ec8f345 100644 --- a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn +++ b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn @@ -309,4 +309,6 @@ available at the time that they are inlined, and the newer unix ctime is used. On the second build, the meta data has already been recorded. This can probably be avoided by processing meta date at scan time. + +Verified, fix works. [[done]] --[[Joey]] -- 2.44.0