X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/54f600af14bf6dc067ffc30ec6f22d517001fe99..c9b737cc8596f9421ba968e56839eb052e80e794:/IkiWiki/Plugin/meta.pm?ds=inline

diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 128a6342c..5cfa72833 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -37,6 +37,7 @@ sub needsbuild (@) {
 			}
 		}
 	}
+	return $needsbuild;
 }
 
 sub scrub ($$) {
@@ -197,8 +198,12 @@ sub preprocess (@) {
 				'" rel="openid2.local_id" />' if $delegate ne 1;
 		}
 		if (exists $params{"xrds-location"} && safeurl($params{"xrds-location"})) {
-			push @{$metaheaders{$page}}, '<meta http-equiv="X-XRDS-Location"'.
-				'content="'.encode_entities($params{"xrds-location"}).'" />';
+			# force url absolute
+			eval q{use URI};
+			error($@) if $@;
+			my $url=URI->new_abs($params{"xrds-location"}, $config{url});
+			push @{$metaheaders{$page}}, '<meta http-equiv="X-XRDS-Location" '.
+				'content="'.encode_entities($url).'" />';
 		}
 	}
 	elsif ($key eq 'redir') {
@@ -253,12 +258,20 @@ sub preprocess (@) {
 			' content="'.encode_entities($value).'" />';
 	}
 	elsif ($key eq 'description') {
-		push @{$metaheaders{$page}}, '<meta name="'.encode_entities($key).
+		push @{$metaheaders{$page}}, '<meta name="'.
+			encode_entities($key).
 			'" content="'.encode_entities($value).'" />';
 	}
+	elsif ($key eq 'name') {
+		push @{$metaheaders{$page}}, scrub('<meta '.$key.'="'.
+			encode_entities($value).
+			join(' ', map { "$_=\"$params{$_}\"" } keys %params).
+			' />', $destpage);
+	}
 	else {
-		push @{$metaheaders{$page}}, scrub('<meta name="'.encode_entities($key).
-			'" content="'.encode_entities($value).'" />', $destpage);
+		push @{$metaheaders{$page}}, scrub('<meta name="'.
+			encode_entities($key).'" content="'.
+			encode_entities($value).'" />', $destpage);
 	}
 
 	return "";
@@ -346,11 +359,11 @@ sub match {
 			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", "" => 1);
+			return IkiWiki::FailReason->new("$re does not match $field of $page", $page => $IkiWiki::DEPEND_CONTENT, "" => 1);
 		}
 	}
 	else {
-		return IkiWiki::FailReason->new("$page does not have a $field", "" => 1);
+		return IkiWiki::FailReason->new("$page does not have a $field", $page => $IkiWiki::DEPEND_CONTENT);
 	}
 }
 
@@ -376,6 +389,10 @@ sub match_copyright ($$;@) {
 	IkiWiki::Plugin::meta::match("copyright", @_);
 }
 
+sub match_guid ($$;@) {
+	IkiWiki::Plugin::meta::match("guid", @_);
+}
+
 package IkiWiki::SortSpec;
 
 sub cmp_meta {