]> sipb.mit.edu Git - ikiwiki.git/commitdiff
fix preview of shortcuts
authorJoey Hess <joey@kodama.kitenet.net>
Wed, 29 Oct 2008 18:20:31 +0000 (14:20 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Wed, 29 Oct 2008 18:20:31 +0000 (14:20 -0400)
Move shortcut processing back to checkconfig, and avoid it failing if the
srcdir is not defined.

IkiWiki/Plugin/shortcut.pm
debian/changelog
doc/bugs/cannot_preview_shortcuts.mdwn

index 7bfce586f5b7a920e7ed8020e6e0becef623b991..77131edb07ac588a7108f5659e686ce1954a45d7 100644 (file)
@@ -7,7 +7,7 @@ use IkiWiki 2.00;
 
 sub import { #{{{
        hook(type => "getsetup", id => "shortcut", call => \&getsetup);
-       hook(type => "refresh", id => "shortcut", call => \&refresh);
+       hook(type => "checkconfig", id => "shortcut", call => \&checkconfig);
        hook(type => "preprocess", id => "shortcut", call => \&preprocess_shortcut);
 } #}}}
 
@@ -19,14 +19,16 @@ sub getsetup () { #{{{
                },
 } #}}}
 
-sub refresh () { #{{{
-       # Preprocess the shortcuts page to get all the available shortcuts
-       # defined before other pages are rendered.
-       my $srcfile=srcfile("shortcuts.mdwn", 1);
-       if (! defined $srcfile) {
-               error(gettext("shortcut plugin will not work without a shortcuts.mdwn"));
+sub checkconfig () { #{{{
+       if (defined $config{srcdir}) {
+               # Preprocess the shortcuts page to get all the available shortcuts
+               # defined before other pages are rendered.
+               my $srcfile=srcfile("shortcuts.mdwn", 1);
+               if (! defined $srcfile) {
+                       error(gettext("shortcut plugin will not work without a shortcuts.mdwn"));
+               }
+               IkiWiki::preprocess("shortcuts", "shortcuts", readfile($srcfile));
        }
-       IkiWiki::preprocess("shortcuts", "shortcuts", readfile($srcfile));
 } # }}}
 
 sub preprocess_shortcut (@) { #{{{
index 299cf1af25ac0ae820949604b7970659611d5bc9..4547cda3d551ccd5ee53c0a8121af135bde1293a 100644 (file)
@@ -36,6 +36,7 @@ ikiwiki (2.68) UNRELEASED; urgency=low
   * Add support for checking pushes from untrusted git committers. This can be
     used to set up anonymous git pushes, and other similar things.
   * git: Allow [[sha1_commit]] to be used in the diffurl, to support cgit.
+  * shortcut: Fix display of shortcuts while previewing.
 
  -- Joey Hess <joeyh@debian.org>  Fri, 17 Oct 2008 20:11:02 -0400
 
index a2fd3533ae5131d4316c42823d1b84295b73111a..2e7ef13b78b7ca0c6917b40fd9d359b5c28d7fc5 100644 (file)
@@ -1,2 +1,4 @@
 Shortcuts such as \[[!google foo]] do not work when previewing pages.
 --[[JasonBlevins]]
+
+> Broken during the setup dumping changes, now fixed. --[[Joey]] [[done]]