]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/edittemplate.pm
edittemplate: only generate a UUID on-demand
[ikiwiki.git] / IkiWiki / Plugin / edittemplate.pm
index 6e8c256da3fdca36addcf8a12a767a6c90d68019..b408dfcac1faf5af44bd03c1c0e4ced5b832107e 100644 (file)
@@ -139,13 +139,15 @@ sub filltemplate ($$) {
 
        $template->param(name => $page);
 
-       eval {
-               require UUID::Tiny;
-               UUID::Tiny->import(':std');
-               my $uuid;
-               $uuid = create_uuid_as_string(UUID_V4());
-               $template->param(uuid => $uuid);
-       };
+       if ($template->query(name => 'uuid')) {
+               eval {
+                       require UUID::Tiny;
+                       UUID::Tiny->import(':std');
+                       my $uuid;
+                       $uuid = create_uuid_as_string(UUID_V4());
+                       $template->param(uuid => $uuid);
+               };
+       }
 
        return $template->output;
 }