]> sipb.mit.edu Git - ikiwiki.git/commitdiff
sidebar: Add global_sidebars setting.
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 15 Apr 2010 21:31:50 +0000 (17:31 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 15 Apr 2010 21:31:50 +0000 (17:31 -0400)
IkiWiki/Plugin/sidebar.pm
debian/changelog
doc/ikiwiki/directive/sidebar.mdwn
doc/plugins/sidebar.mdwn

index d63cb524671210186a4380f7d829716640f7fc52..1b302dcf9f80dde6a6f1a6ba6e5620a34e7af593 100644 (file)
@@ -20,6 +20,13 @@ sub getsetup () {
                        safe => 1,
                        rebuild => 1,
                },
+               global_sidebars => {
+                       type => "boolean",
+                       examples => 1,
+                       description => "show sidebar page on all pages?"
+                       safe => 1,
+                       rebuild => 1,
+               },
 }
 
 my %pagesidebar;
@@ -55,6 +62,8 @@ sub sidebar_content ($) {
        
        return $pagesidebar{$page} if exists $pagesidebar{$page};
 
+       return if defined $config{global_sidebars} && !$config{global_sidebars};
+
        my $sidebar_page=bestlink($page, "sidebar") || return;
        my $sidebar_file=$pagesources{$sidebar_page} || return;
        my $sidebar_type=pagetype($sidebar_file);
index af19f4a009aec0a294f301cf9b9879f0612ef12f..c379253d7e38eb6a98be4f384e93ec540847dd60 100644 (file)
@@ -40,6 +40,7 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low
   * sidebar: Now a sidebar directive can be used to override the sidebar
     shown on a page.
   * Enable calendar and sidebar in auto-blog.setup.
+  * sidebar: Add global_sidebars setting.
 
  -- Joey Hess <joeyh@debian.org>  Sun, 04 Apr 2010 12:17:11 -0400
 
index 46f016747c01da0c3caab8d6332e0c8711e4b224..34f078672e4a60b5cf0e778b3aa24f2819206fc2 100644 (file)
@@ -1,7 +1,7 @@
 The `sidebar` directive is supplied by the [[!iki plugins/sidebar desc=sidebar]] plugin.
 
-This directive specifies a custom sidebar to display on the page, instead
-of any sidebar that is displayed globally.
+This directive specifies a custom sidebar to display on the page,
+overriding any sidebar that is displayed globally.
 
 ## examples
 
index cd0f0ecf12b43e991c7abcf90ae4da32273198df..01273345630233b49720490af9867beaff46f8b5 100644 (file)
@@ -1,9 +1,11 @@
 [[!template id=plugin name=sidebar author="Tuomo Valkonen"]]
 [[!tag type/chrome]]
 
-If this plugin is enabled, then a sidebar is added to pages in the wiki.
-The content of the sidebar is simply the content of a page named
-"sidebar" (ie, create a "sidebar.mdwn").
+This plugin allows adding a sidebar to pages in the wiki.
+
+By default, and unless the `global_sidebars` setting is turned off,
+a sidebar is added to all pages in the wiki. The content of the sidebar
+is simply the content of a page named "sidebar" (ie, create a "sidebar.mdwn").
 
 Typically this will be a page in the root of the wiki, but it can also be a
 [[ikiwiki/SubPage]]. In fact, this page,