]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/todo/varioki_--_add_template_variables___40__with_closures_for_values__41___in_ikiwiki.setup.mdwn
Merge commit '546da9bac7135d7d1b02dce0c0eef2209d939fc6' into sipb
[ikiwiki.git] / doc / todo / varioki_--_add_template_variables___40__with_closures_for_values__41___in_ikiwiki.setup.mdwn
index 431305622fb3275a3b80373bfe6fac92762f97fb..d292a1184892132e880365370900f8c71fc0243c 100644 (file)
@@ -15,7 +15,7 @@ ManojSrivastava
 
 > I think you could now implement "toplvl" using [[conditionals|/plugins/conditional]]:
 >
->     \[[if test="destpage(/index)" then="""...""" else="""..."""]]
+>     \[[!if test="destpage(/index)" then="""...""" else="""..."""]]
 >
 > --[[JoshTriplett]]
 
@@ -33,6 +33,12 @@ ManojSrivastava
 > > directory,  which is not very easy for a plain ol' user.  Not everyone is the
 > >  sysadmin of their own machines with access to system dirs. --ManojSrivastava
 
+>>> It seems worth mentioning here that the `libdir` configuration parameter
+>>> lets you install additional plugins in a user-controlled directory
+>>> (*libdir*`/IkiWiki/Plugin`), avoiding needing root; indeed, a full local
+>>> ikiwiki installation without any involvement from the sysadmin is
+>>> [[possible|tips/DreamHost]]. --[[smcv]]
+
 <pre>
                 varioki => {'motto'    => '"Manoj\'s musings"',
                         'arrayvar' => '[0, 1, 2, 3]',
@@ -47,6 +53,15 @@ ManojSrivastava
                       },
 </pre>
 
+> > I'd argue in favour of this plugin; it's true that a simple plugin can be
+> > used to set a template variable, but that makes it necessary to write a new
+> > plugin for every variable (or set of variables) that are needed. In that
+> > kind of situation, I don't think bypassing the plugin mechanism is a bad
+> > thing, unless an ever-growing collection of plugins to set one or two
+> > variables is a good thing.
+> >
+> > --[[bma]]
+
 ----
 
 <pre>
@@ -148,9 +163,9 @@ ManojSrivastava
 +=cut
 +
 +
-+sub import { #{{{
++sub import {
 +      hook(type => "pagetemplate", id => "varioki", call => \&pagetemplate);
-+} # }}}
++}
 +
 +
 +=pod
@@ -166,7 +181,7 @@ ManojSrivastava
 +
 +=cut
 +
-+sub pagetemplate (@) { #{{{
++sub pagetemplate (@) {
 +      my %params=@_;
 +      my $page=$params{page};
 +      my $template=$params{template};
@@ -198,7 +213,7 @@ ManojSrivastava
 +             $template->param("$var" =>"$value");
 +           }
 +        }
-+} # }}}
++}
 +
 +1;
 +
@@ -254,4 +269,4 @@ ManojSrivastava
 +
 </pre>
 
-[[tag patch]]
+[[!tag patch]]