]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
authorJoey Hess <joey@gnu.kitenet.net>
Sat, 27 Feb 2010 21:37:10 +0000 (16:37 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Sat, 27 Feb 2010 21:37:10 +0000 (16:37 -0500)
doc/todo/beef_up_sidebar_to_allow_for_multiple_sidebars.mdwn
doc/users/Will.mdwn
doc/users/jeanprivat.mdwn [new file with mode: 0644]

index fb942a49552246a0d56ca5e32c6e75d2a85ea0c1..02b83244e3ed2093ad87629cdf1fea0c022c31b2 100644 (file)
@@ -13,5 +13,57 @@ those contents instead.
 
 > In mine I just copied sidebar out and made some extra "sidebars", but they go elsewhere. Ugly hack, but it works. --[[simonraven]]
 
+>> Here a simple [[patch]] for multiple sidebars. Not too fancy but better than having multiple copies of the sidebar plugin. --[[jeanprivat]]
+
+<pre>
+--- /usr/share/perl5/IkiWiki/Plugin/sidebar.pm 2010-02-11 22:53:17.000000000 -0500
++++ plugins/IkiWiki/Plugin/sidebar.pm  2010-02-27 09:54:12.524412391 -0500
+@@ -19,12 +19,20 @@
+                       safe => 1,
+                       rebuild => 1,
+               },
++              active_sidebars => {
++                      type => "string",
++                      example => qw(sidebar banner footer),
++                      description => "Which sidebars must be activated and processed.",
++                      safe => 1,
++                      rebuild => 1
++              },
+ }
+-sub sidebar_content ($) {
++sub sidebar_content ($$) {
+       my $page=shift;
++      my $sidebar=shift;
+       
+-      my $sidebar_page=bestlink($page, "sidebar") || return;
++      my $sidebar_page=bestlink($page, $sidebar) || return;
+       my $sidebar_file=$pagesources{$sidebar_page} || return;
+       my $sidebar_type=pagetype($sidebar_file);
+       
+@@ -49,11 +57,17 @@
+       my $page=$params{page};
+       my $template=$params{template};
+-      
+-      if ($template->query(name => "sidebar")) {
+-              my $content=sidebar_content($page);
+-              if (defined $content && length $content) {
+-                      $template->param(sidebar => $content);
++
++      my @sidebars;
++      if (defined $config{active_sidebars} && length $config{active_sidebars}) { @sidebars = @{$config{active_sidebars}}; }
++      else { @sidebars = qw(sidebar); }
++
++      foreach my $sidebar (@sidebars) {
++              if ($template->query(name => $sidebar)) {
++                      my $content=sidebar_content($page, $sidebar);
++                      if (defined $content && length $content) {
++                              $template->param($sidebar => $content);
++                      }
+               }
+       }
+ }
+</pre>
 
 [[!tag wishlist]]
index f5effdbe3d75d6e813063bb3e6dc576160a90542..1956263e0815eefc69ad9cd2bf70d2a08c1499b7 100644 (file)
@@ -13,14 +13,16 @@ Unless otherwise specified, any code that I post to this wiki I release under th
 
 ------
 
+Disabling these as I'm not using them much any more...
+
 ### Open Bugs:
 
-[[!inline pages="link(users/Will) and bugs/* and !bugs/done and !bugs/discussion and !link(patch) and !link(bugs/done) and !bugs/*/*" archive="yes" feeds="no" ]]
+\[[!inline pages="link(users/Will) and bugs/* and !bugs/done and !bugs/discussion and !link(patch) and !link(bugs/done) and !bugs/*/*" archive="yes" feeds="no" ]]
 
 ### Open ToDos:
 
-[[!inline pages="link(users/Will) and todo/* and !todo/done and !todo/discussion and !link(patch) and !link(todo/done) and !bugs/*/*" archive="yes" feeds="no" ]]
+\[[!inline pages="link(users/Will) and todo/* and !todo/done and !todo/discussion and !link(patch) and !link(todo/done) and !bugs/*/*" archive="yes" feeds="no" ]]
 
 ### Unapplied Patches:
 
-[[!inline pages="link(users/Will) and (todo/* or bugs/*) and !bugs/done and !bugs/discussion and !todo/done and !todo/discussion and link(patch) and !link(bugs/done) and !link(todo/done) and !bugs/*/*" archive="yes" feeds="no" ]]
+\[[!inline pages="link(users/Will) and (todo/* or bugs/*) and !bugs/done and !bugs/discussion and !todo/done and !todo/discussion and link(patch) and !link(bugs/done) and !link(todo/done) and !bugs/*/*" archive="yes" feeds="no" ]]
diff --git a/doc/users/jeanprivat.mdwn b/doc/users/jeanprivat.mdwn
new file mode 100644 (file)
index 0000000..4d75a98
--- /dev/null
@@ -0,0 +1 @@
+Jean Privat is <jean@pryen.org>.