]> 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 e3ce5e3d97437392c681f20f6c3a23b0b9690790..b408dfcac1faf5af44bd03c1c0e4ced5b832107e 100644 (file)
@@ -139,6 +139,16 @@ sub filltemplate ($$) {
 
        $template->param(name => $page);
 
+       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;
 }