]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/meta_rcsid.mdwn
sign my change
[ikiwiki.git] / doc / todo / meta_rcsid.mdwn
1 The following patch adds an 'rcsid' parameter to the [[!taglink plugins/Meta]] plugin, to allow inclusion 
2 of CVS/SVN-style keywords (like '$Id$', etc.) from the source file in the page template.
3
4 > So the idea is you'd write something like:
5
6 >       \[[!meta rcsid="$Id$"]]
7
8 > And this would be put at the bottom of the page or somewhere like that by
9 > the template?
10
11 > I wonder if it wouldn't be just as clear to say:
12
13 >       <span class="rcsid">$Id$</span>
14
15 > And then use a stylesheet to display it as desired.
16 > --[[Joey]]
17
18 >> That's possibly true; my reasoning was that I wanted it to be more independent 
19 >> of the page content, and independent of any stylesheet.
20
21     --- meta.pm.orig    2007-10-10 19:57:04.000000000 +0100
22     +++ meta.pm 2007-10-10 20:07:37.000000000 +0100
23     @@ -13,6 +13,7 @@
24      my %authorurl;
25      my %license;
26      my %copyright;
27     +my %rcsid;
28  
29      sub import {
30         hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
31     @@ -110,6 +111,9 @@
32             $meta{$page}.="<link rel=\"copyright\" href=\"#page_copyright\" />\n";
33             $copyright{$page}=$value;
34         }
35     +    elsif ($key eq 'rcsid') {
36     +        $rcsid{$page}=$value;
37     +    }
38         else {
39             $meta{$page}.=scrub("<meta name=\"".encode_entities($key).
40                 "\" content=\"".encode_entities($value)."\" />\n");
41     @@ -142,6 +146,8 @@
42             if exists $author{$page} && $template->query(name => "author");
43         $template->param(authorurl => $authorurl{$page})
44             if exists $authorurl{$page} && $template->query(name => "authorurl");
45     +    $template->param(rcsid => $rcsid{$page})
46     +        if exists $rcsid{$page} && $template->query(name => "rcsid");
47         
48         if ($page ne $destpage &&
49             ((exists $license{$page}   && ! exists $license{$destpage}) ||
50
51 [[patch]]