X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/523650d9c2b876152aaa9bc6c5d6363377ea7008..8a37be35acb2c2c37d272489d2f2678e47c61834:/IkiWiki/Plugin/meta.pm
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 15bb29b3f..8dcd73a1a 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -110,7 +110,7 @@ sub preprocess (@) {
}
elsif ($key eq 'link' && ! %params) {
# hidden WikiLink
- push @{$links{$page}}, $value;
+ add_link($page, $value);
return "";
}
elsif ($key eq 'author') {
@@ -128,6 +128,13 @@ sub preprocess (@) {
$IkiWiki::pagectime{$page}=$time if defined $time;
}
}
+ 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
@@ -156,17 +163,22 @@ sub preprocess (@) {
"\" type=\"text/css\" />";
}
elsif ($key eq 'openid') {
+ my $delegate=0; # both by default
+ if (exists $params{delegate}) {
+ $delegate = 1 if lc $params{delegate} eq 'openid';
+ $delegate = 2 if lc $params{delegate} eq 'openid2';
+ }
if (exists $params{server} && safeurl($params{server})) {
push @{$metaheaders{$page}}, '';
+ '" rel="openid.server" />' if $delegate ne 2;
push @{$metaheaders{$page}}, '';
+ '" rel="openid2.provider" />' if $delegate ne 1;
}
if (safeurl($value)) {
push @{$metaheaders{$page}}, '';
+ '" rel="openid.delegate" />' if $delegate ne 2;
push @{$metaheaders{$page}}, '';
+ '" rel="openid2.local_id" />' if $delegate ne 1;
}
if (exists $params{"xrds-location"} && safeurl($params{"xrds-location"})) {
push @{$metaheaders{$page}}, 'new("$re matches $field of $page");
+ return IkiWiki::SuccessReason->new("$re matches $field of $page", $page => $IkiWiki::DEPEND_CONTENT, "" => 1);
}
else {
- return IkiWiki::FailReason->new("$re does not match $field of $page");
+ return IkiWiki::FailReason->new("$re does not match $field of $page", "" => 1);
}
}
else {
- return IkiWiki::FailReason->new("$page does not have a $field");
+ return IkiWiki::FailReason->new("$page does not have a $field", "" => 1);
}
}
package IkiWiki::PageSpec;
sub match_title ($$;@) {
- IkiWiki::Plugin::meta::match("title", @_);
+ IkiWiki::Plugin::meta::match("title", @_);
}
sub match_author ($$;@) {