summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2008-11-23 17:42:50 +0000
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2008-12-11 21:14:04 +0000
commite66e2c2a7e2fdf2d80c20e61854480342d3fa8b4 (patch)
tree473e934e28a3ab6ea7cf54cc56fa12ca41eedd7a /IkiWiki
parent8ead8ac85785843b095c10d7bba532563e4d8dc1 (diff)
comments: Use a checkconfig hook to get the default value of comments_pagename
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/comments.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 33d8ca8e2..4cd76c5d5 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -14,6 +14,7 @@ use constant POST_COMMENT => "Post comment";
use constant CANCEL => "Cancel";
sub import { #{{{
+ hook(type => "checkconfig", id => 'comments', call => \&checkconfig);
hook(type => "getsetup", id => 'comments', call => \&getsetup);
hook(type => "preprocess", id => 'comments', call => \&preprocess);
hook(type => "sessioncgi", id => 'comment', call => \&sessioncgi);
@@ -83,6 +84,12 @@ sub getsetup () { #{{{
},
} #}}}
+sub checkconfig () { #{{{
+ $config{comments_commit} = 1 unless defined $config{comments_commit};
+ $config{comments_pagename} = 'comment_'
+ unless defined $config{comments_pagename};
+} #}}}
+
# Somewhat based on IkiWiki::Plugin::inline blog posting support
sub preprocess (@) { #{{{
my %params=@_;