]> scripts.mit.edu Git - www/ikiwiki.git/blobdiff - doc/todo/source_link.mdwn
Add [[!template id=gitbranch]] for things available from git, and use it
[www/ikiwiki.git] / doc / todo / source_link.mdwn
index 5d6cb89e831b8360a5c8ffbf990edbb858bac5e1..9d9ec969713b3778b0581ca5a343471d9efee6c9 100644 (file)
@@ -4,6 +4,11 @@ How about a direct link from the page header to the source of the latest version
 
 I just implemented this.  There is one [[patch]] to the default page template, and a new plugin.  -- [[Will]]
 
+> The use of sessioncgi here seems undesirable: on wikis where anonymity is
+> not allowed, you'll be asked to log in. Couldn't you achieve the same thing
+> by loading the index with IkiWiki::loadindex, like [[plugins/goto]] does?
+> --[[smcv]]
+
 ----
 
     diff --git a/templates/page.tmpl b/templates/page.tmpl
@@ -31,13 +36,13 @@ I just implemented this.  There is one [[patch]] to the default page template, a
     use IkiWiki;
     use open qw{:utf8 :std};
     
-    sub import { #{{{
+    sub import {
        hook(type => "getsetup", id => "getsource", call => \&getsetup);
        hook(type => "pagetemplate", id => "getsource", call => \&pagetemplate);
        hook(type => "sessioncgi", id => "getsource", call => \&cgi_getsource);
-    } # }}}
+    }
     
-    sub getsetup () { #{{{
+    sub getsetup () {
        return
                plugin => {
                        safe => 1,
@@ -50,9 +55,9 @@ I just implemented this.  There is one [[patch]] to the default page template, a
                        safe => 1,
                        rebuild => 0,
                },
-    } #}}}
+    }
     
-    sub pagetemplate (@) { #{{{
+    sub pagetemplate (@) {
        my %params=@_;
     
        my $page=$params{page};
@@ -62,9 +67,9 @@ I just implemented this.  There is one [[patch]] to the default page template, a
                $template->param(getsourceurl => IkiWiki::cgiurl(do => "getsource", page => $page));
                $template->param(have_actions => 1);
        }
-    } # }}}
+    }
     
-    sub cgi_getsource ($$) { #{{{
+    sub cgi_getsource ($$) {
        my $cgi=shift;
        my $session=shift;