- elsif ($key eq 'permalink') {
- $pagestate{$page}{meta}{permalink}=$value;
- push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />');
+ elsif ($key eq 'updated') {
+ eval q{use Date::Parse};
+ if (! $@) {
+ my $time = str2time($value);
+ $pagestate{$page}{meta}{updated}=$time if defined $time;
+ }
+ }
+
+ if (! defined wantarray) {
+ # avoid collecting duplicate data during scan pass
+ return;
+ }
+
+ # Metadata handling that happens only during preprocessing pass.
+ if ($key eq 'permalink') {
+ if (safeurl($value)) {
+ push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />', $destpage);
+ }