]> sipb.mit.edu Git - ikiwiki.git/commitdiff
shortcut: If default_pageext is set, first look for shortcuts.default_pageext
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 12 Feb 2009 18:02:58 +0000 (13:02 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 12 Feb 2009 18:04:20 +0000 (13:04 -0500)
Falls back to looking for shortcuts.mdwn for backwards compatabiity; there
probably exist wikis that have changed the pageext but still use
shortcuts.mdwn.

IkiWiki/Plugin/shortcut.pm
debian/changelog
doc/plugins/mdwn/discussion.mdwn
doc/plugins/shortcut/discussion.mdwn

index 0e7cbd4d12f0705aa8706461c404a154ad8fbf99..c1e6a7eb304e8ac84643a95b03e17684a8235a2d 100644 (file)
@@ -23,9 +23,13 @@ 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);
+               my $srcfile=srcfile("shortcuts.".$config{default_pageext}, 1);
                if (! defined $srcfile) {
-                       error(gettext("shortcut plugin will not work without a shortcuts.mdwn"));
+                       $srcfile=srcfile("shortcuts.mdwn", 1);
+               }
+               if (! defined $srcfile) {
+                       error(sprintf(gettext("shortcut plugin will not work without %s"),
+                               "shortcuts.".$config{default_pageext}));
                }
                IkiWiki::preprocess("shortcuts", "shortcuts", readfile($srcfile));
        }
index 294d231976f9bd364623f48884ce755da85bf757..7467508f684baa30d6248a1cf526bff62c695d21 100644 (file)
@@ -11,6 +11,8 @@ ikiwiki (3.04) UNRELEASED; urgency=low
   * Fix unusual --setup --post-commit command line option combo.
   * Create any missing directory necessary to put the wrapper
     file into. Closes: #514384
+  * shortcut: If default_pageext is set, first look for
+    shortcuts.default_pageext.
 
  -- Joey Hess <joeyh@debian.org>  Sat, 31 Jan 2009 19:04:45 -0500
 
index 9ebf99b7e0149eefc3f29423ba864719f0584628..4b05e7f4e8ea425f60454243b7526b9d54a37f9d 100644 (file)
@@ -5,7 +5,3 @@ you need to overwrite the underlay
 dir (set underlaydir in ikiwiki.setup
 to your own underlay dir or replace underlay pages
 in your $SRC).
-
-Specially, the [[shortcut]] plugin is hardcoded to
-use shortcuts.mdwn.  So you need pay more care if
-you [[use shortcut without mdwn|shortcut/discussion]].
index 770c958368b768ab35d2458bb8fe94c2cd0a8a96..4e11ce08c04230b8d3abdcec2980f7b2f0901c92 100644 (file)
@@ -3,25 +3,10 @@ disabled [[mdwn]], to get [[shortcut]] work, you need
 commit in a shortcuts.ext (ext is `rcs|creole|html|txt|etc`),
 and edit/patch [[shortcut]].
 
-Maybe use the $default_pageext is better than hardcode .mdwn?
-
-<pre>
---- shortcut.pm.orig    2009-02-12 02:05:22.000000000 -0600
-+++ shortcut.pm 2009-02-12 04:41:30.000000000 -0600
-@@ -23,9 +23,9 @@
-        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);
-+               my $srcfile=srcfile("shortcuts.$config{default_pageext}", 1);
-                if (! defined $srcfile) {
--                       error(gettext("shortcut plugin will not work without a shortcuts.mdwn"));
-+                       error(gettext("shortcut plugin will not work without a shortcuts.$config{default_pageext}"));
-                }
-                IkiWiki::preprocess("shortcuts", "shortcuts", readfile($srcfile));
-        }
-</pre>
+Maybe use the `default_pageext` is better than hardcode .mdwn?
 
 --[[weakish]]
 
+> done, it will use `default_pageext` now --[[Joey]] 
+