]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/meta.pm
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
[git.ikiwiki.info.git] / IkiWiki / Plugin / meta.pm
index 128a6342c74a4ad13adb2f0521d85ddfb29232bb..5941e3f3f589fa5fee34f5e871949ed891aa685a 100644 (file)
@@ -37,6 +37,7 @@ sub needsbuild (@) {
                        }
                }
        }
+       return $needsbuild;
 }
 
 sub scrub ($$) {
@@ -253,12 +254,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 +355,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 +385,10 @@ sub match_copyright ($$;@) {
        IkiWiki::Plugin::meta::match("copyright", @_);
 }
 
+sub match_guid ($$;@) {
+       IkiWiki::Plugin::meta::match("guid", @_);
+}
+
 package IkiWiki::SortSpec;
 
 sub cmp_meta {