1 This patch allows disabling the edit and preferences link in the config file. It is backwards compatible (so peoples edit and preferences links won't suddenly vanish).
3 To disable edit or prefs respectively, add the following to the config file:
12 --- /usr/share/perl5/IkiWiki/Render.pm.orig 2008-12-23 16:49:00.000000000 +1300
13 +++ /usr/share/perl5/IkiWiki/Render.pm 2008-12-23 16:55:40.000000000 +1300
17 if (length $config{cgiurl}) {
18 - $template->param(editurl => cgiurl(do => "edit", page => $page));
19 - $template->param(prefsurl => cgiurl(do => "prefs"));
20 + $template->param(editurl => cgiurl(do => "edit", page => $page))
21 + if ! defined $config{edit} || (defined $config{edit} && $config{edit} == 1);
22 + $template->param(prefsurl => cgiurl(do => "prefs"))
23 + if ! defined $config{prefs} || (defined $config{prefs} && $config{prefs} == 1);
29 > On irc, you said, "That was to allow the hack to of using wikistatedir to
30 > allow me to generate two websites, one with inline editting, the other a
31 > static page for public consumption."
33 > The edit and preferences links can already be disabled by editing
34 > `page.tmpl`. (Look for PREFSURL and EDITURL).
36 > More to the point though, disabling those links does not disable anyone
37 > consticting the urls by hand and logging in and editing a page. So you'd
38 > really want to disable the editpage plugin in the setup file for the
39 > public, static wiki. Sounds like you might also want to turn off cgi
40 > entirely for that build. --[[Joey]]
42 >> I want to retain the same page.tmpl for both sites (different templates
43 >> will just increase the maintenance hell), so disabling the links in the
44 >> config for one public site works better in my case.
46 >> I do have the editpage plugin disabled for the public static wiki, but
47 >> the link still appears on the site. I want to keep the cgi on, so that
48 >> the site is still searchable. --[[puck]]