meta: Process meta date during scan pass so that the date will always affect sorting in inlines.

master
Joey Hess 2008-12-21 01:52:08 -05:00
parent da947bea4b
commit c84fcdd32a
3 changed files with 12 additions and 8 deletions

View File

@ -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('<link rel="bookmark" href="'.encode_entities($value).'" />', $destpage);

2
debian/changelog vendored
View File

@ -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 <joeyh@debian.org> Mon, 17 Nov 2008 14:02:10 -0500

View File

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