summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/meta.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2008-12-21 01:52:08 -0500
committerJoey Hess <joey@gnu.kitenet.net>2008-12-21 01:52:08 -0500
commitc84fcdd32aad7a613bf7bbb501362dffcf5ccdeb (patch)
treedafb1c6450151c13f3691d2fa1856be96cf22308 /IkiWiki/Plugin/meta.pm
parentda947bea4be8b388531ff70650d274f8ee8f1500 (diff)
meta: Process meta date during scan pass so that the date will always affect sorting in inlines.
Diffstat (limited to 'IkiWiki/Plugin/meta.pm')
-rw-r--r--IkiWiki/Plugin/meta.pm16
1 files changed, 8 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('<link rel="bookmark" href="'.encode_entities($value).'" />', $destpage);