]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/meta_rcsid.mdwn
400c8637d33dc8d24201666110dcdc7a5a8b0cfa
[ikiwiki.git] / doc / todo / meta_rcsid.mdwn
1 The following patch adds an 'rcsid' parameter to the Meta plugin, to allow inclusion 
2 of CVS/SVN-style keywords (like '$Id$', etc.) from the source file in the page template.
3
4     --- meta.pm.orig    2007-10-10 19:57:04.000000000 +0100
5     +++ meta.pm 2007-10-10 20:07:37.000000000 +0100
6     @@ -13,6 +13,7 @@
7      my %authorurl;
8      my %license;
9      my %copyright;
10     +my %rcsid;
11  
12      sub import { #{{{
13         hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
14     @@ -110,6 +111,9 @@
15             $meta{$page}.="<link rel=\"copyright\" href=\"#page_copyright\" />\n";
16             $copyright{$page}=$value;
17         }
18     +    elsif ($key eq 'rcsid') {
19     +        $rcsid{$page}=$value;
20     +    }
21         else {
22             $meta{$page}.=scrub("<meta name=\"".encode_entities($key).
23                 "\" content=\"".encode_entities($value)."\" />\n");
24     @@ -142,6 +146,8 @@
25             if exists $author{$page} && $template->query(name => "author");
26         $template->param(authorurl => $authorurl{$page})
27             if exists $authorurl{$page} && $template->query(name => "authorurl");
28     +    $template->param(rcsid => $rcsid{$page})
29     +        if exists $rcsid{$page} && $template->query(name => "rcsid");
30         
31         if ($page ne $destpage &&
32             ((exists $license{$page}   && ! exists $license{$destpage}) ||